Use const, move declarations to header files.
authorDan Nicolaescu <dann@ics.uci.edu>
Tue, 27 Jul 2010 03:52:35 +0000 (20:52 -0700)
committerDan Nicolaescu <dann@ics.uci.edu>
Tue, 27 Jul 2010 03:52:35 +0000 (20:52 -0700)
* src/buffer.c (Fset_buffer_multibyte): Remove local extern declaration.

* src/character.c (strwidth, parse_str_to_multibyte): Add const.

* src/character.h (strwidth, parse_str_to_multibyte): Likewise.

* src/charset.c (add_to_log): Remove declaration.

* src/composite.c (syms_of_composite): Remove local extern declarations.

* src/data.c (Finteractive_form): Use const.

* src/dired.c (scmp): Add const.
(directory_files_internal): Remove local extern declaration.

* src/dispextern.h (add_to_log): Remove declaration.
(x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg)
(x_frame_get_and_record_arg, x_default_parameter): Add const.

* src/dispnew.c: Remove duplicate #include <unistd.h>.
(update_window, update_frame_1, init_display): Remove local extern
declarations.

* src/editfns.c (region_limit, syms_of_editfns): Remove local extern
declarations.

* src/emacs.c (main): Remove local extern declaration.

* src/font.c (Qnormal, QCtype, QCfamily, QCweight, QCslant, QCwidth)
(QCheight, QCsize, QCname): Remove declarations.

* src/frame.c (x_get_resource_string, x_get_string_resource)
(x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg)
(x_default_parameter): Use const.

* src/image.c (QCwidth, QCheight, QCforeground, QCbackground, QCfile)
(QCdata, QCtype, Qcenter): Remove declarations.

* src/keyboard.h (do_mouse_tracking): Add declaration.

* src/minibuf.c (Qmouse_face): Remove declaration.

* src/msdos.c (IT_note_mouse_highlight): Remove local extern declaration.

* src/xdisp.c (do_mouse_tracking): Remove declaration.
(add_to_log): Use const.

* src/xfaces.c (Qmouse_face): Remove declaration.
(face_color_gray_p, tty_defined_color, defined_color)
(face_color_gray_p, face_color_supported_p). Add const.

* src/xfns.c: Include xlwmenu.h when USE_LUCID.
(x_defined_color, xic_set_xfontset): Use const.
(Fx_hide_tip): Remove local extern declaration.

* src/xselect.c (selection_data_to_lisp_data)
(x_property_data_to_lisp):
* src/xrdb.c (x_get_string_resource, file_p)
(x_get_customization_string, magic_file_p, search_magic_path)
(get_system_app, get_user_app, x_load_resources, x_get_resource)
(x_get_string_resource): Use const.

* src/xterm.c (xlwmenu_window_p, xlwmenu_redisplay): Remove declarations.
(x_text_icon, x_check_errors, x_connection_closed): Use const.

* src/xterm.h (x_get_customization_string, x_load_resources)
(x_get_resource, x_text_icon, x_text_icon, x_check_errors)
(x_check_errors, x_property_data_to_lisp, defined_color)
(xic_set_xfontset, x_defined_color): Use const.

24 files changed:
src/buffer.c
src/character.c
src/character.h
src/charset.c
src/composite.c
src/data.c
src/dired.c
src/dispextern.h
src/dispnew.c
src/editfns.c
src/emacs.c
src/font.c
src/frame.c
src/image.c
src/keyboard.h
src/minibuf.c
src/msdos.c
src/xdisp.c
src/xfaces.c
src/xfns.c
src/xrdb.c
src/xselect.c
src/xterm.c
src/xterm.h

index a90262f..fe0d200 100644 (file)
@@ -2512,7 +2512,6 @@ current buffer is cleared.  */)
   if (!EQ (old_undo, Qt))
     {
       /* Represent all the above changes by a special undo entry.  */
-      extern Lisp_Object Qapply;
       current_buffer->undo_list = Fcons (list3 (Qapply,
                                                intern ("set-buffer-multibyte"),
                                                NILP (flag) ? Qt : Qnil),
index 470157b..c4a3a00 100644 (file)
@@ -430,7 +430,7 @@ c_string_width (const unsigned char *str, int len, int precision, int *nchars, i
    occupies on the screen.  */
 
 int
-strwidth (unsigned char *str, int len)
+strwidth (const unsigned char *str, int len)
 {
   return c_string_width (str, len, -1, NULL, NULL);
 }
@@ -710,9 +710,9 @@ str_as_multibyte (unsigned char *str, int len, int nbytes, int *nchars)
    `str_to_multibyte'.  */
 
 int
-parse_str_to_multibyte (unsigned char *str, int len)
+parse_str_to_multibyte (const unsigned char *str, int len)
 {
-  unsigned char *endp = str + len;
+  const unsigned char *endp = str + len;
   int bytes;
 
   for (bytes = 0; str < endp; str++)
index b32dabb..8726b2a 100644 (file)
@@ -605,13 +605,13 @@ extern int translate_char (Lisp_Object, int c);
 extern int char_printable_p (int c);
 extern void parse_str_as_multibyte (const unsigned char *, int, int *,
                                     int *);
-extern int parse_str_to_multibyte (unsigned char *, int);
+extern int parse_str_to_multibyte (const unsigned char *, int);
 extern int str_as_multibyte (unsigned char *, int, int, int *);
 extern int str_to_multibyte (unsigned char *, int, int);
 extern int str_as_unibyte (unsigned char *, int);
 extern EMACS_INT str_to_unibyte (const unsigned char *, unsigned char *,
                                  EMACS_INT, int);
-extern int strwidth (unsigned char *, int);
+extern int strwidth (const unsigned char *, int);
 extern int c_string_width (const unsigned char *, int, int, int *, int *);
 extern int lisp_string_width (Lisp_Object, int, int *, int *);
 
index 84df00d..578c05a 100644 (file)
@@ -491,8 +491,6 @@ extern Lisp_Object Qfile_name_handler_alist;
    Note that this function uses `openp' to open MAPFILE but ignores
    `file-name-handler-alist' to avoid running any Lisp code.  */
 
-extern void add_to_log (char *, Lisp_Object, Lisp_Object);
-
 static void
 load_charset_map_from_file (struct charset *charset, Lisp_Object mapfile, int control_flag)
 {
index 4568698..dbd7e3d 100644 (file)
@@ -1939,7 +1939,6 @@ syms_of_composite (void)
   /* Make a hash table for static composition.  */
   {
     Lisp_Object args[6];
-    extern Lisp_Object QCsize;
 
     args[0] = QCtest;
     args[1] = Qequal;
@@ -1959,8 +1958,6 @@ syms_of_composite (void)
   /* Make a hash table for glyph-string.  */
   {
     Lisp_Object args[6];
-    extern Lisp_Object QCsize;
-
     args[0] = QCtest;
     args[1] = Qequal;
     args[2] = QCweakness;
index 152a888..5c7a5de 100644 (file)
@@ -750,7 +750,7 @@ Value, if non-nil, is a list \(interactive SPEC).  */)
 
   if (SUBRP (fun))
     {
-      char *spec = XSUBR (fun)->intspec;
+      const char *spec = XSUBR (fun)->intspec;
       if (spec)
        return list2 (Qinteractive,
                      (*spec != '(') ? build_string (spec) :
index 8f360e8..5006d60 100644 (file)
@@ -115,7 +115,7 @@ Lisp_Object Qfile_name_all_completions;
 Lisp_Object Qfile_attributes;
 Lisp_Object Qfile_attributes_lessp;
 
-static int scmp (unsigned char *, unsigned char *, int);
+static int scmp (const unsigned char *, const unsigned char *, int);
 \f
 #ifdef WINDOWSNT
 Lisp_Object
@@ -206,7 +206,6 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m
 #ifdef WINDOWSNT
   if (attrs)
     {
-      extern Lisp_Object Qlocal;
       extern int is_slow_fs (const char *);
 
       /* Do this only once to avoid doing it (in w32.c:stat) for each
@@ -813,7 +812,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v
    else number of chars that match at the beginning.  */
 
 static int
-scmp (register unsigned char *s1, register unsigned char *s2, int len)
+scmp (const unsigned char *s1, const unsigned char *s2, int len)
 {
   register int l = len;
 
index 5ca7e81..69cc110 100644 (file)
@@ -2951,7 +2951,6 @@ extern Lisp_Object Qtool_bar;
 extern Lisp_Object Vshow_trailing_whitespace;
 extern int mode_line_in_non_selected_windows;
 extern int redisplaying_p;
-extern void add_to_log (char *, Lisp_Object, Lisp_Object);
 extern int help_echo_showing_p;
 extern int current_mode_line_height, current_header_line_height;
 extern Lisp_Object help_echo_string, help_echo_window;
@@ -3322,18 +3321,18 @@ enum resource_types
 };
 
 extern Lisp_Object x_get_arg (Display_Info *, Lisp_Object,
-                              Lisp_Object, char *, char *class,
+                              Lisp_Object, const char *, const char *class,
                               enum resource_types);
 extern Lisp_Object x_frame_get_arg (struct frame *, Lisp_Object,
-                                    Lisp_Object, char *, char *,
+                                    Lisp_Object, const char *, const char *,
                                     enum resource_types);
-extern Lisp_Object x_frame_get_and_record_arg (
-                                               struct frame *, Lisp_Object,
-                                               Lisp_Object, char *, char *,
+extern Lisp_Object x_frame_get_and_record_arg (struct frame *, Lisp_Object,
+                                               Lisp_Object,
+                                              const char *, const char *,
                                                enum resource_types);
 extern Lisp_Object x_default_parameter (struct frame *, Lisp_Object,
                                         Lisp_Object, Lisp_Object,
-                                        char *, char *,
+                                        const char *, const char *,
                                         enum resource_types);
 
 #endif /* HAVE_WINDOW_SYSTEM */
index 73aafe0..0b332c1 100644 (file)
@@ -66,12 +66,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "systime.h"
 #include <errno.h>
 
-/* To get the prototype for `sleep'.  */
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
 /* Get number of chars of output now in the buffer of a stdio stream.
    This ought to be built in in stdio, but it isn't.  Some s- files
    override this because their stdio internals differ.  */
@@ -3664,8 +3658,6 @@ update_window (struct window *w, int force_p)
 #if !PERIODIC_PREEMPTION_CHECKING
   int preempt_count = baud_rate / 2400 + 1;
 #endif
-  extern int input_pending;
-  extern Lisp_Object do_mouse_tracking;
   struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
 #if GLYPH_DEBUG
   /* Check that W's frame doesn't have glyph matrices.  */
@@ -4710,7 +4702,6 @@ update_frame_1 (struct frame *f, int force_p, int inhibit_id_p)
   int i;
   int pause;
   int preempt_count = baud_rate / 2400 + 1;
-  extern int input_pending;
 
   xassert (current_matrix && desired_matrix);
 
@@ -6235,10 +6226,6 @@ init_display (void)
 {
   char *terminal_type;
 
-#ifdef HAVE_X_WINDOWS
-  extern int display_arg;
-#endif
-
   /* Construct the space glyph.  */
   space_glyph.type = CHAR_GLYPH;
   SET_CHAR_GLYPH (space_glyph, ' ', DEFAULT_FACE_ID, 0);
index 96ae176..24140ef 100644 (file)
@@ -320,7 +320,6 @@ The return value is POSITION.  */)
 static Lisp_Object
 region_limit (int beginningp)
 {
-  extern Lisp_Object Vmark_even_if_inactive; /* Defined in callint.c. */
   Lisp_Object m;
 
   if (!NILP (Vtransient_mark_mode)
@@ -4554,7 +4553,6 @@ of the buffer being accessed.  */);
 
   {
     Lisp_Object obuf;
-    extern Lisp_Object Vprin1_to_string_buffer;
     obuf = Fcurrent_buffer ();
     /* Do this here, because init_buffer_once is too early--it won't work.  */
     Fset_buffer (Vprin1_to_string_buffer);
index a5d5711..90a6e27 100644 (file)
@@ -757,7 +757,6 @@ main (int argc, char **argv)
   char *ch_to_dir;
 
 #if GC_MARK_STACK
-  extern Lisp_Object *stack_base;
   stack_base = &dummy;
 #endif
 
index c35716c..05c5003 100644 (file)
@@ -127,12 +127,6 @@ static const struct table_entry width_table[] =
   { 200, { "ultra-expanded", "ultraexpanded", "wide" }}
 };
 
-extern Lisp_Object Qnormal;
-
-/* Symbols representing keys of normal font properties.  */
-extern Lisp_Object QCtype, QCfamily, QCweight, QCslant, QCwidth;
-extern Lisp_Object QCheight, QCsize, QCname;
-
 Lisp_Object QCfoundry, QCadstyle, QCregistry;
 /* Symbols representing keys of font extra info.  */
 Lisp_Object QCspacing, QCdpi, QCscalable, QCotf, QClang, QCscript, QCavgwidth;
index 0cd7377..ea300bd 100644 (file)
@@ -3721,7 +3721,7 @@ validate_x_resource_name (void)
 }
 
 
-extern char *x_get_string_resource (XrmDatabase, char *, char *);
+extern char *x_get_string_resource (XrmDatabase, const char *, const char *);
 extern Display_Info *check_x_display_info (Lisp_Object);
 
 
@@ -3823,7 +3823,7 @@ display_x_get_resource (Display_Info *dpyinfo, Lisp_Object attribute, Lisp_Objec
 /* Used when C code wants a resource value.  */
 /* Called from oldXMenu/Create.c.  */
 char *
-x_get_resource_string (char *attribute, char *class)
+x_get_resource_string (const char *attribute, const char *class)
 {
   char *name_key;
   char *class_key;
@@ -3856,7 +3856,8 @@ x_get_resource_string (char *attribute, char *class)
    and don't let it get stored in any Lisp-visible variables!  */
 
 Lisp_Object
-x_get_arg (Display_Info *dpyinfo, Lisp_Object alist, Lisp_Object param, char *attribute, char *class, enum resource_types type)
+x_get_arg (Display_Info *dpyinfo, Lisp_Object alist, Lisp_Object param,
+          const char *attribute, const char *class, enum resource_types type)
 {
   register Lisp_Object tem;
 
@@ -3954,7 +3955,9 @@ x_get_arg (Display_Info *dpyinfo, Lisp_Object alist, Lisp_Object param, char *at
 }
 
 Lisp_Object
-x_frame_get_arg (struct frame *f, Lisp_Object alist, Lisp_Object param, char *attribute, char *class, enum resource_types type)
+x_frame_get_arg (struct frame *f, Lisp_Object alist, Lisp_Object param,
+                const char *attribute, const char *class,
+                enum resource_types type)
 {
   return x_get_arg (FRAME_X_DISPLAY_INFO (f),
                    alist, param, attribute, class, type);
@@ -3963,7 +3966,10 @@ x_frame_get_arg (struct frame *f, Lisp_Object alist, Lisp_Object param, char *at
 /* Like x_frame_get_arg, but also record the value in f->param_alist.  */
 
 Lisp_Object
-x_frame_get_and_record_arg (struct frame *f, Lisp_Object alist, Lisp_Object param, char *attribute, char *class, enum resource_types type)
+x_frame_get_and_record_arg (struct frame *f, Lisp_Object alist,
+                           Lisp_Object param,
+                           const char *attribute, const char *class,
+                           enum resource_types type)
 {
   Lisp_Object value;
 
@@ -3983,7 +3989,9 @@ x_frame_get_and_record_arg (struct frame *f, Lisp_Object alist, Lisp_Object para
    If that is not found either, use the value DEFLT.  */
 
 Lisp_Object
-x_default_parameter (struct frame *f, Lisp_Object alist, Lisp_Object prop, Lisp_Object deflt, char *xprop, char *xclass, enum resource_types type)
+x_default_parameter (struct frame *f, Lisp_Object alist, Lisp_Object prop,
+                    Lisp_Object deflt, const char *xprop, const char *xclass,
+                    enum resource_types type)
 {
   Lisp_Object tem;
 
index d55d3ca..b628aab 100644 (file)
@@ -578,9 +578,6 @@ Lisp_Object Qxbm;
 
 /* Keywords.  */
 
-extern Lisp_Object QCwidth, QCheight, QCforeground, QCbackground, QCfile;
-extern Lisp_Object QCdata, QCtype;
-extern Lisp_Object Qcenter;
 Lisp_Object QCascent, QCmargin, QCrelief, Qcount, Qextension_data;
 Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask;
 Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask;
index a6eb750..648b150 100644 (file)
@@ -406,6 +406,8 @@ extern widget_value *digest_single_submenu (int, int, int);
 #define POSN_INBUFFER_P(posn) (NILP (POSN_STRING (posn)))
 #define POSN_BUFFER_POSN(posn) (Fnth (make_number (5), (posn)))
 
+extern Lisp_Object do_mouse_tracking;
+
 /* Some of the event heads.  */
 extern Lisp_Object Qswitch_frame;
 
index 01478c2..d95af7d 100644 (file)
@@ -145,8 +145,6 @@ Lisp_Object Qread_expression_history;
 
 extern Lisp_Object Voverriding_local_map;
 
-extern Lisp_Object Qmouse_face;
-
 extern Lisp_Object Qfield;
 \f
 /* Put minibuf on currently selected frame's minibuffer.
index 8bfdce2..6985002 100644 (file)
@@ -1330,7 +1330,6 @@ IT_note_mouse_highlight (struct frame *f, int x, int y)
 
       /* Check for mouse-face and help-echo.  */
       {
-       extern Lisp_Object Qmouse_face;
        Lisp_Object mouse_face, overlay, position, *overlay_vec;
        int noverlays, obegv, ozv;
        struct buffer *obuf;
index 53fba8c..a1a03d3 100644 (file)
@@ -276,8 +276,6 @@ extern void set_frame_menubar (struct frame *f, int, int);
 extern int interrupt_input;
 extern int command_loop_level;
 
-extern Lisp_Object do_mouse_tracking;
-
 extern int minibuffer_auto_raise;
 extern Lisp_Object Vminibuffer_list;
 
@@ -7966,7 +7964,7 @@ in_display_vector_p (struct it *it)
    to *Messages*.  */
 
 void
-add_to_log (char *format, Lisp_Object arg1, Lisp_Object arg2)
+add_to_log (const char *format, Lisp_Object arg1, Lisp_Object arg2)
 {
   Lisp_Object args[3];
   Lisp_Object msg, fmt;
index c0c53f3..259ee15 100644 (file)
@@ -411,7 +411,6 @@ Lisp_Object Qforeground_color, Qbackground_color;
 /* The symbols `face' and `mouse-face' used as text properties.  */
 
 Lisp_Object Qface;
-extern Lisp_Object Qmouse_face;
 
 /* Property for basic faces which other faces cannot inherit.  */
 
@@ -520,7 +519,7 @@ static int load_pixmap (struct frame *, Lisp_Object, unsigned *, unsigned *);
 static struct frame *frame_or_selected_frame (Lisp_Object, int);
 static void load_face_colors (struct frame *, struct face *, Lisp_Object *);
 static void free_face_colors (struct frame *, struct face *);
-static int face_color_gray_p (struct frame *, char *);
+static int face_color_gray_p (struct frame *, const char *);
 static struct face *realize_face (struct face_cache *, Lisp_Object *,
                                   int);
 static struct face *realize_non_ascii_face (struct frame *, Lisp_Object,
@@ -1171,7 +1170,8 @@ tty_lookup_color (struct frame *f, Lisp_Object color, XColor *tty_color, XColor
 /* A version of defined_color for non-X frames.  */
 
 int
-tty_defined_color (struct frame *f, char *color_name, XColor *color_def, int alloc)
+tty_defined_color (struct frame *f, const char *color_name,
+                  XColor *color_def, int alloc)
 {
   int status = 1;
 
@@ -1206,7 +1206,7 @@ tty_defined_color (struct frame *f, char *color_name, XColor *color_def, int all
    This does the right thing for any type of frame.  */
 
 int
-defined_color (struct frame *f, char *color_name, XColor *color_def, int alloc)
+defined_color (struct frame *f, const char *color_name, XColor *color_def, int alloc)
 {
   if (!FRAME_WINDOW_P (f))
     return tty_defined_color (f, color_name, color_def, alloc);
@@ -1266,7 +1266,7 @@ tty_color_name (struct frame *f, int idx)
    The criterion implemented here is not a terribly sophisticated one.  */
 
 static int
-face_color_gray_p (struct frame *f, char *color_name)
+face_color_gray_p (struct frame *f, const char *color_name)
 {
   XColor color;
   int gray_p;
@@ -1293,7 +1293,7 @@ face_color_gray_p (struct frame *f, char *color_name)
    color.  */
 
 static int
-face_color_supported_p (struct frame *f, char *color_name, int background_p)
+face_color_supported_p (struct frame *f, const char *color_name, int background_p)
 {
   Lisp_Object frame;
   XColor not_used;
index ee02037..0d468eb 100644 (file)
@@ -101,6 +101,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <Xm/FileSB.h>
 #endif
 
+#ifdef USE_LUCID
+#include "../lwlib/xlwmenu.h"
+#endif
+
 #if !defined(NO_EDITRES)
 #define HACK_EDITRES
 extern void _XEditResCheckMessages ();
@@ -650,7 +654,8 @@ gamma_correct (struct frame *f, XColor *color)
    no color could be allocated.  */
 
 int
-x_defined_color (struct frame *f, char *color_name, XColor *color, int alloc_p)
+x_defined_color (struct frame *f, const char *color_name,
+                XColor *color, int alloc_p)
 {
   int success_p;
   Display *dpy = FRAME_X_DISPLAY (f);
@@ -2353,7 +2358,7 @@ xic_set_statusarea (struct frame *f)
    BASE_FONTNAME.  Called when a new Emacs fontset is chosen.  */
 
 void
-xic_set_xfontset (struct frame *f, char *base_fontname)
+xic_set_xfontset (struct frame *f, const char *base_fontname)
 {
   XVaNestedList attr;
   XFontSet xfs;
@@ -5205,7 +5210,6 @@ Value is t if tooltip was open, nil otherwise.  */)
       {
        struct frame *f = SELECTED_FRAME ();
        Widget w = f->output_data.x->menubar_widget;
-        extern void xlwmenu_redisplay (Widget);
 
        if (!DoesSaveUnders (FRAME_X_DISPLAY_INFO (f)->screen)
            && w != NULL)
index 513768e..9c814b0 100644 (file)
@@ -82,8 +82,9 @@ extern char *get_system_name (void);
 #define free xfree
 #endif
 
-char *x_get_string_resource (XrmDatabase rdb, char *name, char *class);
-static int file_p (char *filename);
+char *x_get_string_resource (XrmDatabase rdb, const char *name,
+                            const char *class);
+static int file_p (const char *filename);
 
 \f
 /* X file search path processing.  */
@@ -98,7 +99,7 @@ char *x_customization_string;
    resource, for later use in search path decoding.  If we find no
    such resource, return zero.  */
 char *
-x_get_customization_string (XrmDatabase db, char *name, char *class)
+x_get_customization_string (XrmDatabase db, const char *name, const char *class)
 {
   char *full_name
     = (char *) alloca (strlen (name) + sizeof ("customization") + 3);
@@ -153,7 +154,7 @@ x_get_customization_string (XrmDatabase db, char *name, char *class)
    Return NULL otherwise.  */
 
 static char *
-magic_file_p (char *string, int string_len, char *class, char *escaped_suffix, char *suffix)
+magic_file_p (const char *string, int string_len, const char *class, const char *escaped_suffix, const char *suffix)
 {
   char *lang = getenv ("LANG");
 
@@ -161,12 +162,12 @@ magic_file_p (char *string, int string_len, char *class, char *escaped_suffix, c
   char *path = (char *) malloc (path_size);
   int path_len = 0;
 
-  char *p = string;
+  const char *p = string;
 
   while (p < string + string_len)
     {
       /* The chunk we're about to stick on the end of result.  */
-      char *next = NULL;
+      const char *next = NULL;
       int next_len;
 
       if (*p == '%')
@@ -306,7 +307,7 @@ gethomedir (void)
 
 
 static int
-file_p (char *filename)
+file_p (const char *filename)
 {
   struct stat status;
 
@@ -321,9 +322,9 @@ file_p (char *filename)
    the path name of the one we found otherwise.  */
 
 static char *
-search_magic_path (char *search_path, char *class, char *escaped_suffix, char *suffix)
+search_magic_path (const char *search_path, const char *class, const char *escaped_suffix, const char *suffix)
 {
-  register char *s, *p;
+  const char *s, *p;
 
   for (s = search_path; *s; s = p)
     {
@@ -332,7 +333,8 @@ search_magic_path (char *search_path, char *class, char *escaped_suffix, char *s
 
       if (p > s)
        {
-         char *path = magic_file_p (s, p - s, class, escaped_suffix, suffix);
+         char *path = magic_file_p (s, p - s, class, escaped_suffix,
+                                          suffix);
          if (path)
            return path;
        }
@@ -356,7 +358,7 @@ search_magic_path (char *search_path, char *class, char *escaped_suffix, char *s
 /* Producing databases for individual sources.  */
 
 static XrmDatabase
-get_system_app (char *class)
+get_system_app (const char *class)
 {
   XrmDatabase db = NULL;
   char *path;
@@ -383,7 +385,7 @@ get_fallback (Display *display)
 
 
 static XrmDatabase
-get_user_app (char *class)
+get_user_app (const char *class)
 {
   char *path;
   char *file = 0;
@@ -494,17 +496,18 @@ XrmRepresentation x_rm_string;    /* Quark representation */
 /* Load X resources based on the display and a possible -xrm option. */
 
 XrmDatabase
-x_load_resources (Display *display, char *xrm_string, char *myname, char *myclass)
+x_load_resources (Display *display, const char *xrm_string,
+                 const char *myname, const char *myclass)
 {
   XrmDatabase user_database;
   XrmDatabase rdb;
   XrmDatabase db;
   char line[256];
 
-  char *helv = "-*-helvetica-medium-r-*--*-120-*-*-*-*-iso8859-1";
+  const char *helv = "-*-helvetica-medium-r-*--*-120-*-*-*-*-iso8859-1";
 
 #ifdef USE_MOTIF
-  char *courier = "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1";
+  const char *courier = "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1";
   extern Lisp_Object Vdouble_click_time;
 #endif
 
@@ -628,7 +631,7 @@ x_load_resources (Display *display, char *xrm_string, char *myname, char *myclas
    and of type TYPE from database RDB.  The value is returned in RET_VALUE. */
 
 int
-x_get_resource (XrmDatabase rdb, char *name, char *class, XrmRepresentation expected_type, XrmValue *ret_value)
+x_get_resource (XrmDatabase rdb, const char *name, const char *class, XrmRepresentation expected_type, XrmValue *ret_value)
 {
   XrmValue value;
   XrmName namelist[100];
@@ -656,7 +659,7 @@ x_get_resource (XrmDatabase rdb, char *name, char *class, XrmRepresentation expe
    database RDB. */
 
 char *
-x_get_string_resource (XrmDatabase rdb, char *name, char *class)
+x_get_string_resource (XrmDatabase rdb, const char *name, const char *class)
 {
   XrmValue value;
 
index cd03073..69d9ca8 100644 (file)
@@ -76,7 +76,8 @@ static void receive_incremental_selection (Display *, Window, Atom,
 static Lisp_Object x_get_window_property_as_lisp_data (Display *,
                                                        Window, Atom,
                                                        Lisp_Object, Atom);
-static Lisp_Object selection_data_to_lisp_data (Display *, unsigned char *,
+static Lisp_Object selection_data_to_lisp_data (Display *,
+                                               const unsigned char *,
                                                 int, Atom, int);
 static void lisp_data_to_selection_data (Display *, Lisp_Object,
                                          unsigned char **, Atom *,
@@ -1758,7 +1759,8 @@ x_get_window_property_as_lisp_data (Display *display, Window window,
 
 
 static Lisp_Object
-selection_data_to_lisp_data (Display *display, unsigned char *data, int size, Atom type, int format)
+selection_data_to_lisp_data (Display *display, const unsigned char *data,
+                            int size, Atom type, int format)
 {
   struct x_display_info *dpyinfo = x_display_info_for_display (display);
 
@@ -2540,7 +2542,8 @@ x_fill_property_data (Display *dpy, Lisp_Object data, void *ret, int format)
    Also see comment for selection_data_to_lisp_data above.  */
 
 Lisp_Object
-x_property_data_to_lisp (struct frame *f, unsigned char *data, Atom type, int format, long unsigned int size)
+x_property_data_to_lisp (struct frame *f, const unsigned char *data,
+                        Atom type, int format, long unsigned int size)
 {
   return selection_data_to_lisp_data (FRAME_X_DISPLAY (f),
                                       data, size*format/8, type, format);
index ddc7a16..d4a6885 100644 (file)
@@ -104,8 +104,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #endif
 
 #ifdef USE_LUCID
-extern int xlwmenu_window_p (Widget w, Window window);
-extern void xlwmenu_redisplay (Widget);
+#include "../lwlib/xlwmenu.h"
 #endif
 
 #if defined (USE_X_TOOLKIT) || defined (USE_GTK)
@@ -332,7 +331,8 @@ Lisp_Object Qx_gtk_map_stock;
 
 extern Lisp_Object Vinhibit_redisplay;
 
-extern XrmDatabase x_load_resources (Display *, char *, char *, char *);
+extern XrmDatabase x_load_resources (Display *, const char *, const char *,
+                                    const char *);
 extern int x_bitmap_mask (FRAME_PTR, int);
 
 static int x_alloc_nearest_color_1 (Display *, Colormap, XColor *);
@@ -379,7 +379,7 @@ static int handle_one_xevent (struct x_display_info *, XEvent *,
                               int *, struct input_event *);
 /* Don't declare this NO_RETURN because we want no
    interference with debugging failing X calls.  */
-static SIGTYPE x_connection_closed (Display *, char *);
+static SIGTYPE x_connection_closed (Display *, const char *);
 
 
 /* Flush display of frame F, or of all frames if F is null.  */
@@ -7359,7 +7359,7 @@ x_bitmap_icon (struct frame *f, Lisp_Object file)
    Use ICON_NAME as the text.  */
 
 int
-x_text_icon (struct frame *f, char *icon_name)
+x_text_icon (struct frame *f, const char *icon_name)
 {
   if (FRAME_X_WINDOW (f) == 0)
     return 1;
@@ -7422,7 +7422,7 @@ x_error_catcher (Display *display, XErrorEvent *error)
 
    Calling x_uncatch_errors resumes the normal error handling.  */
 
-void x_check_errors (Display *dpy, char *format);
+void x_check_errors (Display *dpy, const char *format);
 
 void
 x_catch_errors (Display *dpy)
@@ -7464,7 +7464,7 @@ x_uncatch_errors (void)
    sprintf (a buffer, FORMAT, the x error message text) as the text.  */
 
 void
-x_check_errors (Display *dpy, char *format)
+x_check_errors (Display *dpy, const char *format)
 {
   /* Make sure to catch any errors incurred so far.  */
   XSync (dpy, False);
@@ -7568,7 +7568,7 @@ x_fatal_error_signal (void)
    the text of an error message that lead to the connection loss.  */
 
 static SIGTYPE
-x_connection_closed (Display *dpy, char *error_message)
+x_connection_closed (Display *dpy, const char *error_message)
 {
   struct x_display_info *dpyinfo = x_display_info_for_display (dpy);
   Lisp_Object frame, tail;
index 5c1213d..d9215d5 100644 (file)
@@ -936,15 +936,16 @@ extern void x_free_gcs (struct frame *);
 
 /* From xrdb.c.  */
 
-char *x_get_customization_string (XrmDatabase, char *, char *);
-XrmDatabase x_load_resources (Display *, char *, char *, char *);
-int x_get_resource (XrmDatabase, char *, char *,
+char *x_get_customization_string (XrmDatabase, const char *, const char *);
+XrmDatabase x_load_resources (Display *, const char *, const char *,
+                             const char *);
+int x_get_resource (XrmDatabase, const char *, const char *,
                     XrmRepresentation, XrmValue *);
 void x_delete_display (struct x_display_info *);
 void x_make_frame_visible (struct frame *);
 void x_iconify_frame (struct frame *);
 void x_wm_set_size_hint (struct frame *, long, int);
-int x_text_icon (struct frame *, char *);
+int x_text_icon (struct frame *, const char *);
 int x_bitmap_icon (struct frame *, Lisp_Object);
 void x_set_window_size (struct frame *, int, int, int);
 void x_wm_set_window_state (struct frame *, int);
@@ -954,10 +955,10 @@ int x_alloc_nearest_color (struct frame *, Colormap, XColor *);
 
 extern void cancel_mouse_face (struct frame *);
 extern void x_scroll_bar_clear (struct frame *);
-extern int x_text_icon (struct frame *, char *);
+extern int x_text_icon (struct frame *, const char *);
 extern int x_bitmap_icon (struct frame *, Lisp_Object);
 extern void x_catch_errors (Display *);
-extern void x_check_errors (Display *, char *);
+extern void x_check_errors (Display *, const char *);
 extern int x_had_errors_p (Display *);
 extern int x_catching_errors (void);
 extern void x_uncatch_errors (void);
@@ -1018,7 +1019,7 @@ extern void x_fill_property_data (Display *,
                                   void *,
                                   int);
 extern Lisp_Object x_property_data_to_lisp (struct frame *,
-                                            unsigned char *,
+                                            const unsigned char *,
                                             Atom,
                                             int,
                                             unsigned long);
@@ -1033,7 +1034,7 @@ extern int xg_set_icon_from_xpm_data (struct frame *, char**);
 #endif /* USE_GTK */
 
 extern void x_real_positions (struct frame *, int *, int *);
-extern int defined_color (struct frame *, char *, XColor *, int);
+extern int defined_color (struct frame *, const char *, XColor *, int);
 extern void x_set_border_pixel (struct frame *, int);
 extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
@@ -1042,14 +1043,14 @@ extern void create_frame_xic (struct frame *);
 extern void destroy_frame_xic (struct frame *);
 extern void xic_set_preeditarea (struct window *, int, int);
 extern void xic_set_statusarea (struct frame *);
-extern void xic_set_xfontset (struct frame *, char *);
+extern void xic_set_xfontset (struct frame *, const char *);
 extern int x_pixel_width (struct frame *);
 extern int x_pixel_height (struct frame *);
 extern int x_char_width (struct frame *);
 extern int x_char_height (struct frame *);
 extern int x_screen_planes (struct frame *);
 extern void x_sync (struct frame *);
-extern int x_defined_color (struct frame *, char *, XColor *, int);
+extern int x_defined_color (struct frame *, const char *, XColor *, int);
 #ifdef HAVE_X_I18N
 extern void free_frame_xic (struct frame *);
 #endif