diff options
| author | Dan Nicolaescu | 2010-08-09 02:35:21 -0700 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-08-09 02:35:21 -0700 |
| commit | 8ea90aa3525a93194e98b7e1b2ea77e96ca3dde6 (patch) | |
| tree | d2719f3f91a5aeac252e14e777ceea6aea06527d /src | |
| parent | 443c2c0301d7d69efa875510d7a4530573b5e76c (diff) | |
| download | emacs-8ea90aa3525a93194e98b7e1b2ea77e96ca3dde6.tar.gz emacs-8ea90aa3525a93194e98b7e1b2ea77e96ca3dde6.zip | |
Use const char* instead of char*.
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 29 | ||||
| -rw-r--r-- | src/buffer.c | 2 | ||||
| -rw-r--r-- | src/dispextern.h | 8 | ||||
| -rw-r--r-- | src/editfns.c | 10 | ||||
| -rw-r--r-- | src/fileio.c | 4 | ||||
| -rw-r--r-- | src/filelock.c | 8 | ||||
| -rw-r--r-- | src/floatfns.c | 4 | ||||
| -rw-r--r-- | src/font.c | 8 | ||||
| -rw-r--r-- | src/gtkutil.c | 18 | ||||
| -rw-r--r-- | src/gtkutil.h | 2 | ||||
| -rw-r--r-- | src/keyboard.c | 6 | ||||
| -rw-r--r-- | src/keymap.c | 6 | ||||
| -rw-r--r-- | src/keymap.h | 2 | ||||
| -rw-r--r-- | src/lread.c | 4 | ||||
| -rw-r--r-- | src/process.c | 9 | ||||
| -rw-r--r-- | src/search.c | 2 | ||||
| -rw-r--r-- | src/sound.c | 22 | ||||
| -rw-r--r-- | src/sysdep.c | 2 | ||||
| -rw-r--r-- | src/term.c | 10 | ||||
| -rw-r--r-- | src/unexelf.c | 2 | ||||
| -rw-r--r-- | src/xrdb.c | 5 |
21 files changed, 97 insertions, 66 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 405a3f346e7..6fd89a6339d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,32 @@ | |||
| 1 | 2010-08-09 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | Use const char* instead of char*. | ||
| 4 | Reduce the number of warnings with -Wwrite-strings. | ||
| 5 | * xrdb.c (get_environ_db, get_system_name): | ||
| 6 | * unexelf.c (find_section): | ||
| 7 | * term.c (string_cost, string_cost_one_line, per_line_cost) | ||
| 8 | (get_named_tty, init_tty): | ||
| 9 | * sysdep.c (sys_subshell): | ||
| 10 | * sound.c (sound_perror, sound_warning, vox_open, vox_init) | ||
| 11 | (alsa_sound_perror, alsa_open, alsa_configure, alsa_init): | ||
| 12 | * search.c (Freplace_match): | ||
| 13 | * process.c (Fmake_network_process, send_process, init_process): | ||
| 14 | * lread.c (Fload, init_lread): | ||
| 15 | * keymap.c (Fdescribe_buffer_bindings, describe_map_tree): | ||
| 16 | * keyboard.c (parse_tool_bar_item, struct event_head): | ||
| 17 | * gtkutil.h (xg_get_font_name): | ||
| 18 | * gtkutil.c (get_dialog_title, create_dialog, xg_get_font_name) | ||
| 19 | (make_widget_for_menu_item, make_menu_item, create_menus) | ||
| 20 | (xg_make_tool_item): | ||
| 21 | * font.c (parse_matrix, font_parse_name): | ||
| 22 | * floatfns.c (rounding_driver, float_error_fn_name): | ||
| 23 | * filelock.c (get_boot_time_1, lock_file_1): | ||
| 24 | * fileio.c (barf_or_query_if_file_exists, check_writable): | ||
| 25 | * editfns.c (get_system_name, get_operating_system_release) | ||
| 26 | (Fencode_time, Fset_time_zone_rule): | ||
| 27 | * dispextern.h (string_cost, per_line_cost, get_named_tty, init_tty): | ||
| 28 | * buffer.c (defvar_per_buffer): Use const. | ||
| 29 | |||
| 1 | 2010-08-08 Kenichi Handa <handa@m17n.org> | 30 | 2010-08-08 Kenichi Handa <handa@m17n.org> |
| 2 | 31 | ||
| 3 | * charset.c: Include <stdlib.h> | 32 | * charset.c: Include <stdlib.h> |
diff --git a/src/buffer.c b/src/buffer.c index 7d42489dd30..39fabf581bb 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -5283,7 +5283,7 @@ init_buffer (void) | |||
| 5283 | } while (0) | 5283 | } while (0) |
| 5284 | 5284 | ||
| 5285 | static void | 5285 | static void |
| 5286 | defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, char *namestring, | 5286 | defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, const char *namestring, |
| 5287 | Lisp_Object *address, Lisp_Object type, char *doc) | 5287 | Lisp_Object *address, Lisp_Object type, char *doc) |
| 5288 | { | 5288 | { |
| 5289 | struct Lisp_Symbol *sym; | 5289 | struct Lisp_Symbol *sym; |
diff --git a/src/dispextern.h b/src/dispextern.h index 44ea4349250..c36db91ea02 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -3275,18 +3275,18 @@ extern void tty_set_terminal_modes (struct terminal *); | |||
| 3275 | extern void tty_reset_terminal_modes (struct terminal *); | 3275 | extern void tty_reset_terminal_modes (struct terminal *); |
| 3276 | extern void tty_turn_off_insert (struct tty_display_info *); | 3276 | extern void tty_turn_off_insert (struct tty_display_info *); |
| 3277 | extern void tty_turn_off_highlight (struct tty_display_info *); | 3277 | extern void tty_turn_off_highlight (struct tty_display_info *); |
| 3278 | extern int string_cost (char *); | 3278 | extern int string_cost (const char *); |
| 3279 | extern int per_line_cost (char *); | 3279 | extern int per_line_cost (const char *); |
| 3280 | extern void calculate_costs (struct frame *); | 3280 | extern void calculate_costs (struct frame *); |
| 3281 | extern void produce_glyphs (struct it *); | 3281 | extern void produce_glyphs (struct it *); |
| 3282 | extern void produce_special_glyphs (struct it *, enum display_element_type); | 3282 | extern void produce_special_glyphs (struct it *, enum display_element_type); |
| 3283 | extern int tty_capable_p (struct tty_display_info *, unsigned, unsigned long, unsigned long); | 3283 | extern int tty_capable_p (struct tty_display_info *, unsigned, unsigned long, unsigned long); |
| 3284 | extern void set_tty_color_mode (struct tty_display_info *, struct frame *); | 3284 | extern void set_tty_color_mode (struct tty_display_info *, struct frame *); |
| 3285 | extern struct terminal *get_tty_terminal (Lisp_Object, int); | 3285 | extern struct terminal *get_tty_terminal (Lisp_Object, int); |
| 3286 | extern struct terminal *get_named_tty (char *); | 3286 | extern struct terminal *get_named_tty (const char *); |
| 3287 | EXFUN (Ftty_type, 1); | 3287 | EXFUN (Ftty_type, 1); |
| 3288 | extern void create_tty_output (struct frame *); | 3288 | extern void create_tty_output (struct frame *); |
| 3289 | extern struct terminal *init_tty (char *, char *, int); | 3289 | extern struct terminal *init_tty (const char *, const char *, int); |
| 3290 | 3290 | ||
| 3291 | 3291 | ||
| 3292 | /* Defined in scroll.c */ | 3292 | /* Defined in scroll.c */ |
diff --git a/src/editfns.c b/src/editfns.c index 0e034cc76fd..1bd6682c3b6 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -1404,16 +1404,16 @@ DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0, | |||
| 1404 | 1404 | ||
| 1405 | /* For the benefit of callers who don't want to include lisp.h */ | 1405 | /* For the benefit of callers who don't want to include lisp.h */ |
| 1406 | 1406 | ||
| 1407 | char * | 1407 | const char * |
| 1408 | get_system_name (void) | 1408 | get_system_name (void) |
| 1409 | { | 1409 | { |
| 1410 | if (STRINGP (Vsystem_name)) | 1410 | if (STRINGP (Vsystem_name)) |
| 1411 | return (char *) SDATA (Vsystem_name); | 1411 | return (const char *) SDATA (Vsystem_name); |
| 1412 | else | 1412 | else |
| 1413 | return ""; | 1413 | return ""; |
| 1414 | } | 1414 | } |
| 1415 | 1415 | ||
| 1416 | char * | 1416 | const char * |
| 1417 | get_operating_system_release (void) | 1417 | get_operating_system_release (void) |
| 1418 | { | 1418 | { |
| 1419 | if (STRINGP (Voperating_system_release)) | 1419 | if (STRINGP (Voperating_system_release)) |
| @@ -1819,7 +1819,7 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */) | |||
| 1819 | else | 1819 | else |
| 1820 | { | 1820 | { |
| 1821 | char tzbuf[100]; | 1821 | char tzbuf[100]; |
| 1822 | char *tzstring; | 1822 | const char *tzstring; |
| 1823 | char **oldenv = environ, **newenv; | 1823 | char **oldenv = environ, **newenv; |
| 1824 | 1824 | ||
| 1825 | if (EQ (zone, Qt)) | 1825 | if (EQ (zone, Qt)) |
| @@ -2001,7 +2001,7 @@ If TZ is nil, use implementation-defined default time zone information. | |||
| 2001 | If TZ is t, use Universal Time. */) | 2001 | If TZ is t, use Universal Time. */) |
| 2002 | (Lisp_Object tz) | 2002 | (Lisp_Object tz) |
| 2003 | { | 2003 | { |
| 2004 | char *tzstring; | 2004 | const char *tzstring; |
| 2005 | 2005 | ||
| 2006 | /* When called for the first time, save the original TZ. */ | 2006 | /* When called for the first time, save the original TZ. */ |
| 2007 | if (!environbuf) | 2007 | if (!environbuf) |
diff --git a/src/fileio.c b/src/fileio.c index f4bad89d0c0..a04cd4e76f5 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -1823,7 +1823,7 @@ expand_and_dir_to_file (Lisp_Object filename, Lisp_Object defdir) | |||
| 1823 | If QUICK is nonzero, we ask for y or n, not yes or no. */ | 1823 | If QUICK is nonzero, we ask for y or n, not yes or no. */ |
| 1824 | 1824 | ||
| 1825 | void | 1825 | void |
| 1826 | barf_or_query_if_file_exists (Lisp_Object absname, unsigned char *querystring, int interactive, struct stat *statptr, int quick) | 1826 | barf_or_query_if_file_exists (Lisp_Object absname, const unsigned char *querystring, int interactive, struct stat *statptr, int quick) |
| 1827 | { | 1827 | { |
| 1828 | register Lisp_Object tem, encoded_filename; | 1828 | register Lisp_Object tem, encoded_filename; |
| 1829 | struct stat statbuf; | 1829 | struct stat statbuf; |
| @@ -2473,7 +2473,7 @@ check_executable (char *filename) | |||
| 2473 | /* Return nonzero if file FILENAME exists and can be written. */ | 2473 | /* Return nonzero if file FILENAME exists and can be written. */ |
| 2474 | 2474 | ||
| 2475 | static int | 2475 | static int |
| 2476 | check_writable (char *filename) | 2476 | check_writable (const char *filename) |
| 2477 | { | 2477 | { |
| 2478 | #ifdef MSDOS | 2478 | #ifdef MSDOS |
| 2479 | struct stat st; | 2479 | struct stat st; |
diff --git a/src/filelock.c b/src/filelock.c index 25ca23fdee4..15ed546bc50 100644 --- a/src/filelock.c +++ b/src/filelock.c | |||
| @@ -118,7 +118,7 @@ static time_t boot_time; | |||
| 118 | static int boot_time_initialized; | 118 | static int boot_time_initialized; |
| 119 | 119 | ||
| 120 | #ifdef BOOT_TIME | 120 | #ifdef BOOT_TIME |
| 121 | static void get_boot_time_1 (char *, int); | 121 | static void get_boot_time_1 (const char *, int); |
| 122 | #endif | 122 | #endif |
| 123 | 123 | ||
| 124 | static time_t | 124 | static time_t |
| @@ -249,7 +249,7 @@ get_boot_time (void) | |||
| 249 | Success is indicated by setting BOOT_TIME to a larger value. */ | 249 | Success is indicated by setting BOOT_TIME to a larger value. */ |
| 250 | 250 | ||
| 251 | void | 251 | void |
| 252 | get_boot_time_1 (char *filename, int newest) | 252 | get_boot_time_1 (const char *filename, int newest) |
| 253 | { | 253 | { |
| 254 | struct utmp ut, *utp; | 254 | struct utmp ut, *utp; |
| 255 | int desc; | 255 | int desc; |
| @@ -360,8 +360,8 @@ lock_file_1 (char *lfname, int force) | |||
| 360 | { | 360 | { |
| 361 | register int err; | 361 | register int err; |
| 362 | time_t boot_time; | 362 | time_t boot_time; |
| 363 | char *user_name; | 363 | const char *user_name; |
| 364 | char *host_name; | 364 | const char *host_name; |
| 365 | char *lock_info_str; | 365 | char *lock_info_str; |
| 366 | 366 | ||
| 367 | /* Call this first because it can GC. */ | 367 | /* Call this first because it can GC. */ |
diff --git a/src/floatfns.c b/src/floatfns.c index 4c1548cfd8f..1c3e40eefde 100644 --- a/src/floatfns.c +++ b/src/floatfns.c | |||
| @@ -117,7 +117,7 @@ static int in_float; | |||
| 117 | 117 | ||
| 118 | static Lisp_Object float_error_arg, float_error_arg2; | 118 | static Lisp_Object float_error_arg, float_error_arg2; |
| 119 | 119 | ||
| 120 | static char *float_error_fn_name; | 120 | static const char *float_error_fn_name; |
| 121 | 121 | ||
| 122 | /* Evaluate the floating point expression D, recording NUM | 122 | /* Evaluate the floating point expression D, recording NUM |
| 123 | as the original argument for error messages. | 123 | as the original argument for error messages. |
| @@ -746,7 +746,7 @@ static Lisp_Object | |||
| 746 | rounding_driver (Lisp_Object arg, Lisp_Object divisor, | 746 | rounding_driver (Lisp_Object arg, Lisp_Object divisor, |
| 747 | double (*double_round) (double), | 747 | double (*double_round) (double), |
| 748 | EMACS_INT (*int_round2) (EMACS_INT, EMACS_INT), | 748 | EMACS_INT (*int_round2) (EMACS_INT, EMACS_INT), |
| 749 | char *name) | 749 | const char *name) |
| 750 | { | 750 | { |
| 751 | CHECK_NUMBER_OR_FLOAT (arg); | 751 | CHECK_NUMBER_OR_FLOAT (arg); |
| 752 | 752 | ||
diff --git a/src/font.c b/src/font.c index f902ff4c588..1ac994d6375 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -699,9 +699,9 @@ font_put_extra (Lisp_Object font, Lisp_Object prop, Lisp_Object val) | |||
| 699 | 699 | ||
| 700 | /* Font name parser and unparser */ | 700 | /* Font name parser and unparser */ |
| 701 | 701 | ||
| 702 | static int parse_matrix (char *); | 702 | static int parse_matrix (const char *); |
| 703 | static int font_expand_wildcards (Lisp_Object *, int); | 703 | static int font_expand_wildcards (Lisp_Object *, int); |
| 704 | static int font_parse_name (char *, Lisp_Object); | 704 | static int font_parse_name (const char *, Lisp_Object); |
| 705 | 705 | ||
| 706 | /* An enumerator for each field of an XLFD font name. */ | 706 | /* An enumerator for each field of an XLFD font name. */ |
| 707 | enum xlfd_field_index | 707 | enum xlfd_field_index |
| @@ -758,7 +758,7 @@ enum xlfd_field_mask | |||
| 758 | -1. */ | 758 | -1. */ |
| 759 | 759 | ||
| 760 | static int | 760 | static int |
| 761 | parse_matrix (char *p) | 761 | parse_matrix (const char *p) |
| 762 | { | 762 | { |
| 763 | double matrix[4]; | 763 | double matrix[4]; |
| 764 | char *end; | 764 | char *end; |
| @@ -1765,7 +1765,7 @@ font_unparse_gtkname (Lisp_Object font, struct frame *f, char *name, int nbytes) | |||
| 1765 | 0. Otherwise return -1. */ | 1765 | 0. Otherwise return -1. */ |
| 1766 | 1766 | ||
| 1767 | static int | 1767 | static int |
| 1768 | font_parse_name (char *name, Lisp_Object font) | 1768 | font_parse_name (const char *name, Lisp_Object font) |
| 1769 | { | 1769 | { |
| 1770 | if (name[0] == '-' || strchr (name, '*') || strchr (name, '?')) | 1770 | if (name[0] == '-' || strchr (name, '*') || strchr (name, '?')) |
| 1771 | return font_parse_xlfd (name, font); | 1771 | return font_parse_xlfd (name, font); |
diff --git a/src/gtkutil.c b/src/gtkutil.c index bef52afd9e8..b1591b79f9c 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -1183,10 +1183,10 @@ xg_set_frame_icon (FRAME_PTR f, Pixmap icon_pixmap, Pixmap icon_mask) | |||
| 1183 | /* Return the dialog title to use for a dialog of type KEY. | 1183 | /* Return the dialog title to use for a dialog of type KEY. |
| 1184 | This is the encoding used by lwlib. We use the same for GTK. */ | 1184 | This is the encoding used by lwlib. We use the same for GTK. */ |
| 1185 | 1185 | ||
| 1186 | static char * | 1186 | static const char * |
| 1187 | get_dialog_title (char key) | 1187 | get_dialog_title (char key) |
| 1188 | { | 1188 | { |
| 1189 | char *title = ""; | 1189 | const char *title = ""; |
| 1190 | 1190 | ||
| 1191 | switch (key) { | 1191 | switch (key) { |
| 1192 | case 'E': case 'e': | 1192 | case 'E': case 'e': |
| @@ -1243,7 +1243,7 @@ create_dialog (widget_value *wv, | |||
| 1243 | GCallback select_cb, | 1243 | GCallback select_cb, |
| 1244 | GCallback deactivate_cb) | 1244 | GCallback deactivate_cb) |
| 1245 | { | 1245 | { |
| 1246 | char *title = get_dialog_title (wv->name[0]); | 1246 | const char *title = get_dialog_title (wv->name[0]); |
| 1247 | int total_buttons = wv->name[1] - '0'; | 1247 | int total_buttons = wv->name[1] - '0'; |
| 1248 | int right_buttons = wv->name[4] - '0'; | 1248 | int right_buttons = wv->name[4] - '0'; |
| 1249 | int left_buttons; | 1249 | int left_buttons; |
| @@ -1761,7 +1761,7 @@ xg_get_file_name (FRAME_PTR f, | |||
| 1761 | DEFAULT_NAME, if non-zero, is the default font name. */ | 1761 | DEFAULT_NAME, if non-zero, is the default font name. */ |
| 1762 | 1762 | ||
| 1763 | char * | 1763 | char * |
| 1764 | xg_get_font_name (FRAME_PTR f, char *default_name) | 1764 | xg_get_font_name (FRAME_PTR f, const char *default_name) |
| 1765 | { | 1765 | { |
| 1766 | GtkWidget *w; | 1766 | GtkWidget *w; |
| 1767 | char *fontname = NULL; | 1767 | char *fontname = NULL; |
| @@ -1971,7 +1971,7 @@ menu_destroy_callback (GtkWidget *w, gpointer client_data) | |||
| 1971 | Returns the GtkHBox. */ | 1971 | Returns the GtkHBox. */ |
| 1972 | 1972 | ||
| 1973 | static GtkWidget * | 1973 | static GtkWidget * |
| 1974 | make_widget_for_menu_item (char *utf8_label, char *utf8_key) | 1974 | make_widget_for_menu_item (const char *utf8_label, const char *utf8_key) |
| 1975 | { | 1975 | { |
| 1976 | GtkWidget *wlbl; | 1976 | GtkWidget *wlbl; |
| 1977 | GtkWidget *wkey; | 1977 | GtkWidget *wkey; |
| @@ -2009,8 +2009,8 @@ make_widget_for_menu_item (char *utf8_label, char *utf8_key) | |||
| 2009 | but the MacOS X version doesn't either, so I guess that is OK. */ | 2009 | but the MacOS X version doesn't either, so I guess that is OK. */ |
| 2010 | 2010 | ||
| 2011 | static GtkWidget * | 2011 | static GtkWidget * |
| 2012 | make_menu_item (char *utf8_label, | 2012 | make_menu_item (const char *utf8_label, |
| 2013 | char *utf8_key, | 2013 | const char *utf8_key, |
| 2014 | widget_value *item, | 2014 | widget_value *item, |
| 2015 | GSList **group) | 2015 | GSList **group) |
| 2016 | { | 2016 | { |
| @@ -2238,7 +2238,7 @@ create_menus (widget_value *data, | |||
| 2238 | int add_tearoff_p, | 2238 | int add_tearoff_p, |
| 2239 | GtkWidget *topmenu, | 2239 | GtkWidget *topmenu, |
| 2240 | xg_menu_cb_data *cl_data, | 2240 | xg_menu_cb_data *cl_data, |
| 2241 | char *name) | 2241 | const char *name) |
| 2242 | { | 2242 | { |
| 2243 | widget_value *item; | 2243 | widget_value *item; |
| 2244 | GtkWidget *wmenu = topmenu; | 2244 | GtkWidget *wmenu = topmenu; |
| @@ -3977,7 +3977,7 @@ static GtkToolItem * | |||
| 3977 | xg_make_tool_item (FRAME_PTR f, | 3977 | xg_make_tool_item (FRAME_PTR f, |
| 3978 | GtkWidget *wimage, | 3978 | GtkWidget *wimage, |
| 3979 | GtkWidget **wbutton, | 3979 | GtkWidget **wbutton, |
| 3980 | char *label, | 3980 | const char *label, |
| 3981 | int i) | 3981 | int i) |
| 3982 | { | 3982 | { |
| 3983 | GtkToolItem *ti = gtk_tool_item_new (); | 3983 | GtkToolItem *ti = gtk_tool_item_new (); |
diff --git a/src/gtkutil.h b/src/gtkutil.h index b09c82aeb0e..75620c54d10 100644 --- a/src/gtkutil.h +++ b/src/gtkutil.h | |||
| @@ -133,7 +133,7 @@ extern char *xg_get_file_name (FRAME_PTR f, | |||
| 133 | int mustmatch_p, | 133 | int mustmatch_p, |
| 134 | int only_dir_p); | 134 | int only_dir_p); |
| 135 | 135 | ||
| 136 | extern char *xg_get_font_name (FRAME_PTR f, char *); | 136 | extern char *xg_get_font_name (FRAME_PTR f, const char *); |
| 137 | 137 | ||
| 138 | extern GtkWidget *xg_create_widget (const char *type, | 138 | extern GtkWidget *xg_create_widget (const char *type, |
| 139 | const char *name, | 139 | const char *name, |
diff --git a/src/keyboard.c b/src/keyboard.c index f12395544b9..1ec3fbe7460 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -8326,8 +8326,8 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item) | |||
| 8326 | /* Try to make one from caption and key. */ | 8326 | /* Try to make one from caption and key. */ |
| 8327 | Lisp_Object key = PROP (TOOL_BAR_ITEM_KEY); | 8327 | Lisp_Object key = PROP (TOOL_BAR_ITEM_KEY); |
| 8328 | Lisp_Object capt = PROP (TOOL_BAR_ITEM_CAPTION); | 8328 | Lisp_Object capt = PROP (TOOL_BAR_ITEM_CAPTION); |
| 8329 | char *label = SYMBOLP (key) ? (char *) SDATA (SYMBOL_NAME (key)) : ""; | 8329 | const char *label = SYMBOLP (key) ? (char *) SDATA (SYMBOL_NAME (key)) : ""; |
| 8330 | char *caption = STRINGP (capt) ? (char *) SDATA (capt) : ""; | 8330 | const char *caption = STRINGP (capt) ? (char *) SDATA (capt) : ""; |
| 8331 | char buf[64]; | 8331 | char buf[64]; |
| 8332 | EMACS_INT max_lbl = 2*tool_bar_max_label_size; | 8332 | EMACS_INT max_lbl = 2*tool_bar_max_label_size; |
| 8333 | Lisp_Object new_lbl; | 8333 | Lisp_Object new_lbl; |
| @@ -11532,7 +11532,7 @@ init_keyboard (void) | |||
| 11532 | event header symbols and put properties on them. */ | 11532 | event header symbols and put properties on them. */ |
| 11533 | struct event_head { | 11533 | struct event_head { |
| 11534 | Lisp_Object *var; | 11534 | Lisp_Object *var; |
| 11535 | char *name; | 11535 | const char *name; |
| 11536 | Lisp_Object *kind; | 11536 | Lisp_Object *kind; |
| 11537 | }; | 11537 | }; |
| 11538 | 11538 | ||
diff --git a/src/keymap.c b/src/keymap.c index 166ec4fa224..cc25d350d44 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -2962,7 +2962,7 @@ The optional argument MENUS, if non-nil, says to mention menu bindings. | |||
| 2962 | register Lisp_Object start1; | 2962 | register Lisp_Object start1; |
| 2963 | struct gcpro gcpro1; | 2963 | struct gcpro gcpro1; |
| 2964 | 2964 | ||
| 2965 | char *alternate_heading | 2965 | const char *alternate_heading |
| 2966 | = "\ | 2966 | = "\ |
| 2967 | Keyboard translations:\n\n\ | 2967 | Keyboard translations:\n\n\ |
| 2968 | You type Translation\n\ | 2968 | You type Translation\n\ |
| @@ -3134,13 +3134,13 @@ You type Translation\n\ | |||
| 3134 | 3134 | ||
| 3135 | void | 3135 | void |
| 3136 | describe_map_tree (Lisp_Object startmap, int partial, Lisp_Object shadow, | 3136 | describe_map_tree (Lisp_Object startmap, int partial, Lisp_Object shadow, |
| 3137 | Lisp_Object prefix, char *title, int nomenu, int transl, | 3137 | Lisp_Object prefix, const char *title, int nomenu, int transl, |
| 3138 | int always_title, int mention_shadow) | 3138 | int always_title, int mention_shadow) |
| 3139 | { | 3139 | { |
| 3140 | Lisp_Object maps, orig_maps, seen, sub_shadows; | 3140 | Lisp_Object maps, orig_maps, seen, sub_shadows; |
| 3141 | struct gcpro gcpro1, gcpro2, gcpro3; | 3141 | struct gcpro gcpro1, gcpro2, gcpro3; |
| 3142 | int something = 0; | 3142 | int something = 0; |
| 3143 | char *key_heading | 3143 | const char *key_heading |
| 3144 | = "\ | 3144 | = "\ |
| 3145 | key binding\n\ | 3145 | key binding\n\ |
| 3146 | --- -------\n"; | 3146 | --- -------\n"; |
diff --git a/src/keymap.h b/src/keymap.h index b47d4e8aa5b..c68d763204d 100644 --- a/src/keymap.h +++ b/src/keymap.h | |||
| @@ -43,7 +43,7 @@ extern Lisp_Object get_keyelt (Lisp_Object, int); | |||
| 43 | extern Lisp_Object get_keymap (Lisp_Object, int, int); | 43 | extern Lisp_Object get_keymap (Lisp_Object, int, int); |
| 44 | EXFUN (Fset_keymap_parent, 2); | 44 | EXFUN (Fset_keymap_parent, 2); |
| 45 | extern void describe_map_tree (Lisp_Object, int, Lisp_Object, Lisp_Object, | 45 | extern void describe_map_tree (Lisp_Object, int, Lisp_Object, Lisp_Object, |
| 46 | char *, int, int, int, int); | 46 | const char *, int, int, int, int); |
| 47 | extern int current_minor_maps (Lisp_Object **, Lisp_Object **); | 47 | extern int current_minor_maps (Lisp_Object **, Lisp_Object **); |
| 48 | extern void initial_define_key (Lisp_Object, int, const char *); | 48 | extern void initial_define_key (Lisp_Object, int, const char *); |
| 49 | extern void initial_define_lispy_key (Lisp_Object, const char *, const char *); | 49 | extern void initial_define_lispy_key (Lisp_Object, const char *, const char *); |
diff --git a/src/lread.c b/src/lread.c index c69c9fadcb9..b616e30c3c6 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -984,7 +984,7 @@ Return t if the file exists and loads successfully. */) | |||
| 984 | int compiled = 0; | 984 | int compiled = 0; |
| 985 | Lisp_Object handler; | 985 | Lisp_Object handler; |
| 986 | int safe_p = 1; | 986 | int safe_p = 1; |
| 987 | char *fmode = "r"; | 987 | const char *fmode = "r"; |
| 988 | Lisp_Object tmp[2]; | 988 | Lisp_Object tmp[2]; |
| 989 | int version; | 989 | int version; |
| 990 | 990 | ||
| @@ -3971,7 +3971,7 @@ static Lisp_Object dump_path; | |||
| 3971 | void | 3971 | void |
| 3972 | init_lread (void) | 3972 | init_lread (void) |
| 3973 | { | 3973 | { |
| 3974 | char *normal; | 3974 | const char *normal; |
| 3975 | int turn_off_warning = 0; | 3975 | int turn_off_warning = 0; |
| 3976 | 3976 | ||
| 3977 | /* Compute the default load-path. */ | 3977 | /* Compute the default load-path. */ |
diff --git a/src/process.c b/src/process.c index 36f5a7d5adb..4a658623077 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -180,7 +180,7 @@ extern Lisp_Object QCfilter; | |||
| 180 | #define SIGCHLD SIGCLD | 180 | #define SIGCHLD SIGCLD |
| 181 | #endif /* SIGCLD */ | 181 | #endif /* SIGCLD */ |
| 182 | 182 | ||
| 183 | extern char *get_operating_system_release (void); | 183 | extern const char *get_operating_system_release (void); |
| 184 | 184 | ||
| 185 | /* Serial processes require termios or Windows. */ | 185 | /* Serial processes require termios or Windows. */ |
| 186 | #if defined (HAVE_TERMIOS) || defined (WINDOWSNT) | 186 | #if defined (HAVE_TERMIOS) || defined (WINDOWSNT) |
| @@ -3033,7 +3033,8 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3033 | #ifdef HAVE_GETADDRINFO | 3033 | #ifdef HAVE_GETADDRINFO |
| 3034 | struct addrinfo ai, *res, *lres; | 3034 | struct addrinfo ai, *res, *lres; |
| 3035 | struct addrinfo hints; | 3035 | struct addrinfo hints; |
| 3036 | char *portstring, portbuf[128]; | 3036 | const char *portstring; |
| 3037 | char portbuf[128]; | ||
| 3037 | #else /* HAVE_GETADDRINFO */ | 3038 | #else /* HAVE_GETADDRINFO */ |
| 3038 | struct _emacs_addrinfo | 3039 | struct _emacs_addrinfo |
| 3039 | { | 3040 | { |
| @@ -5415,7 +5416,7 @@ send_process_trap (int ignore) | |||
| 5415 | This function can evaluate Lisp code and can garbage collect. */ | 5416 | This function can evaluate Lisp code and can garbage collect. */ |
| 5416 | 5417 | ||
| 5417 | static void | 5418 | static void |
| 5418 | send_process (volatile Lisp_Object proc, unsigned char *volatile buf, | 5419 | send_process (volatile Lisp_Object proc, const unsigned char *volatile buf, |
| 5419 | volatile int len, volatile Lisp_Object object) | 5420 | volatile int len, volatile Lisp_Object object) |
| 5420 | { | 5421 | { |
| 5421 | /* Use volatile to protect variables from being clobbered by longjmp. */ | 5422 | /* Use volatile to protect variables from being clobbered by longjmp. */ |
| @@ -7423,7 +7424,7 @@ init_process (void) | |||
| 7423 | processes. As such, we only change the default value. */ | 7424 | processes. As such, we only change the default value. */ |
| 7424 | if (initialized) | 7425 | if (initialized) |
| 7425 | { | 7426 | { |
| 7426 | char *release = get_operating_system_release (); | 7427 | const char *release = get_operating_system_release (); |
| 7427 | if (!release || !release[0] || (release[0] < MIN_PTY_KERNEL_VERSION | 7428 | if (!release || !release[0] || (release[0] < MIN_PTY_KERNEL_VERSION |
| 7428 | && release[1] == '.')) { | 7429 | && release[1] == '.')) { |
| 7429 | Vprocess_connection_type = Qnil; | 7430 | Vprocess_connection_type = Qnil; |
diff --git a/src/search.c b/src/search.c index fbbc59f631d..0e9840b2e5f 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -2655,7 +2655,7 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2655 | for (pos_byte = 0, pos = 0; pos_byte < length;) | 2655 | for (pos_byte = 0, pos = 0; pos_byte < length;) |
| 2656 | { | 2656 | { |
| 2657 | unsigned char str[MAX_MULTIBYTE_LENGTH]; | 2657 | unsigned char str[MAX_MULTIBYTE_LENGTH]; |
| 2658 | unsigned char *add_stuff = NULL; | 2658 | const unsigned char *add_stuff = NULL; |
| 2659 | int add_len = 0; | 2659 | int add_len = 0; |
| 2660 | int idx = -1; | 2660 | int idx = -1; |
| 2661 | 2661 | ||
diff --git a/src/sound.c b/src/sound.c index 2b23ae400a7..55804c328a8 100644 --- a/src/sound.c +++ b/src/sound.c | |||
| @@ -115,10 +115,10 @@ enum sound_attr | |||
| 115 | }; | 115 | }; |
| 116 | 116 | ||
| 117 | #ifdef HAVE_ALSA | 117 | #ifdef HAVE_ALSA |
| 118 | static void alsa_sound_perror (char *, int) NO_RETURN; | 118 | static void alsa_sound_perror (const char *, int) NO_RETURN; |
| 119 | #endif | 119 | #endif |
| 120 | static void sound_perror (char *) NO_RETURN; | 120 | static void sound_perror (const char *) NO_RETURN; |
| 121 | static void sound_warning (char *); | 121 | static void sound_warning (const char *); |
| 122 | static int parse_sound (Lisp_Object, Lisp_Object *); | 122 | static int parse_sound (Lisp_Object, Lisp_Object *); |
| 123 | 123 | ||
| 124 | /* END: Common Definitions */ | 124 | /* END: Common Definitions */ |
| @@ -329,7 +329,7 @@ static int do_play_sound (const char *, unsigned long); | |||
| 329 | /* Like perror, but signals an error. */ | 329 | /* Like perror, but signals an error. */ |
| 330 | 330 | ||
| 331 | static void | 331 | static void |
| 332 | sound_perror (char *msg) | 332 | sound_perror (const char *msg) |
| 333 | { | 333 | { |
| 334 | int saved_errno = errno; | 334 | int saved_errno = errno; |
| 335 | 335 | ||
| @@ -347,7 +347,7 @@ sound_perror (char *msg) | |||
| 347 | /* Display a warning message. */ | 347 | /* Display a warning message. */ |
| 348 | 348 | ||
| 349 | static void | 349 | static void |
| 350 | sound_warning (char *msg) | 350 | sound_warning (const char *msg) |
| 351 | { | 351 | { |
| 352 | message (msg); | 352 | message (msg); |
| 353 | } | 353 | } |
| @@ -727,7 +727,7 @@ au_play (struct sound *s, struct sound_device *sd) | |||
| 727 | static void | 727 | static void |
| 728 | vox_open (struct sound_device *sd) | 728 | vox_open (struct sound_device *sd) |
| 729 | { | 729 | { |
| 730 | char *file; | 730 | const char *file; |
| 731 | 731 | ||
| 732 | /* Open the sound device. Default is /dev/dsp. */ | 732 | /* Open the sound device. Default is /dev/dsp. */ |
| 733 | if (sd->file) | 733 | if (sd->file) |
| @@ -872,7 +872,7 @@ vox_choose_format (struct sound_device *sd, struct sound *s) | |||
| 872 | static int | 872 | static int |
| 873 | vox_init (struct sound_device *sd) | 873 | vox_init (struct sound_device *sd) |
| 874 | { | 874 | { |
| 875 | char *file; | 875 | const char *file; |
| 876 | int fd; | 876 | int fd; |
| 877 | 877 | ||
| 878 | /* Open the sound device. Default is /dev/dsp. */ | 878 | /* Open the sound device. Default is /dev/dsp. */ |
| @@ -915,7 +915,7 @@ vox_write (struct sound_device *sd, const char *buffer, int nbytes) | |||
| 915 | /* This driver is available on GNU/Linux. */ | 915 | /* This driver is available on GNU/Linux. */ |
| 916 | 916 | ||
| 917 | static void | 917 | static void |
| 918 | alsa_sound_perror (char *msg, int err) | 918 | alsa_sound_perror (const char *msg, int err) |
| 919 | { | 919 | { |
| 920 | error ("%s: %s", msg, snd_strerror (err)); | 920 | error ("%s: %s", msg, snd_strerror (err)); |
| 921 | } | 921 | } |
| @@ -934,7 +934,7 @@ struct alsa_params | |||
| 934 | static void | 934 | static void |
| 935 | alsa_open (struct sound_device *sd) | 935 | alsa_open (struct sound_device *sd) |
| 936 | { | 936 | { |
| 937 | char *file; | 937 | const char *file; |
| 938 | struct alsa_params *p; | 938 | struct alsa_params *p; |
| 939 | int err; | 939 | int err; |
| 940 | 940 | ||
| @@ -1056,7 +1056,7 @@ alsa_configure (struct sound_device *sd) | |||
| 1056 | int chn; | 1056 | int chn; |
| 1057 | snd_mixer_t *handle; | 1057 | snd_mixer_t *handle; |
| 1058 | snd_mixer_elem_t *e; | 1058 | snd_mixer_elem_t *e; |
| 1059 | char *file = sd->file ? sd->file : DEFAULT_ALSA_SOUND_DEVICE; | 1059 | const char *file = sd->file ? sd->file : DEFAULT_ALSA_SOUND_DEVICE; |
| 1060 | 1060 | ||
| 1061 | if (snd_mixer_open (&handle, 0) >= 0) | 1061 | if (snd_mixer_open (&handle, 0) >= 0) |
| 1062 | { | 1062 | { |
| @@ -1220,7 +1220,7 @@ snd_error_quiet (const char *file, int line, const char *function, int err, | |||
| 1220 | static int | 1220 | static int |
| 1221 | alsa_init (struct sound_device *sd) | 1221 | alsa_init (struct sound_device *sd) |
| 1222 | { | 1222 | { |
| 1223 | char *file; | 1223 | const char *file; |
| 1224 | snd_pcm_t *handle; | 1224 | snd_pcm_t *handle; |
| 1225 | int err; | 1225 | int err; |
| 1226 | 1226 | ||
diff --git a/src/sysdep.c b/src/sysdep.c index 331be6d5997..2ae3c509522 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -630,7 +630,7 @@ sys_subshell (void) | |||
| 630 | 630 | ||
| 631 | if (pid == 0) | 631 | if (pid == 0) |
| 632 | { | 632 | { |
| 633 | char *sh = 0; | 633 | const char *sh = 0; |
| 634 | 634 | ||
| 635 | #ifdef DOS_NT /* MW, Aug 1993 */ | 635 | #ifdef DOS_NT /* MW, Aug 1993 */ |
| 636 | getwd (oldwd); | 636 | getwd (oldwd); |
diff --git a/src/term.c b/src/term.c index 96f9ce02f9b..4f326234956 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -1087,7 +1087,7 @@ tty_ins_del_lines (struct frame *f, int vpos, int n) | |||
| 1087 | not counting any line-dependent padding. */ | 1087 | not counting any line-dependent padding. */ |
| 1088 | 1088 | ||
| 1089 | int | 1089 | int |
| 1090 | string_cost (char *str) | 1090 | string_cost (const char *str) |
| 1091 | { | 1091 | { |
| 1092 | cost = 0; | 1092 | cost = 0; |
| 1093 | if (str) | 1093 | if (str) |
| @@ -1099,7 +1099,7 @@ string_cost (char *str) | |||
| 1099 | counting any line-dependent padding at one line. */ | 1099 | counting any line-dependent padding at one line. */ |
| 1100 | 1100 | ||
| 1101 | static int | 1101 | static int |
| 1102 | string_cost_one_line (char *str) | 1102 | string_cost_one_line (const char *str) |
| 1103 | { | 1103 | { |
| 1104 | cost = 0; | 1104 | cost = 0; |
| 1105 | if (str) | 1105 | if (str) |
| @@ -1111,7 +1111,7 @@ string_cost_one_line (char *str) | |||
| 1111 | in tenths of characters. */ | 1111 | in tenths of characters. */ |
| 1112 | 1112 | ||
| 1113 | int | 1113 | int |
| 1114 | per_line_cost (char *str) | 1114 | per_line_cost (const char *str) |
| 1115 | { | 1115 | { |
| 1116 | cost = 0; | 1116 | cost = 0; |
| 1117 | if (str) | 1117 | if (str) |
| @@ -2301,7 +2301,7 @@ get_tty_terminal (Lisp_Object terminal, int throw) | |||
| 2301 | Returns NULL if the named terminal device is not opened. */ | 2301 | Returns NULL if the named terminal device is not opened. */ |
| 2302 | 2302 | ||
| 2303 | struct terminal * | 2303 | struct terminal * |
| 2304 | get_named_tty (char *name) | 2304 | get_named_tty (const char *name) |
| 2305 | { | 2305 | { |
| 2306 | struct terminal *t; | 2306 | struct terminal *t; |
| 2307 | 2307 | ||
| @@ -3372,7 +3372,7 @@ dissociate_if_controlling_tty (int fd) | |||
| 3372 | If MUST_SUCCEED is true, then all errors are fatal. */ | 3372 | If MUST_SUCCEED is true, then all errors are fatal. */ |
| 3373 | 3373 | ||
| 3374 | struct terminal * | 3374 | struct terminal * |
| 3375 | init_tty (char *name, char *terminal_type, int must_succeed) | 3375 | init_tty (const char *name, const char *terminal_type, int must_succeed) |
| 3376 | { | 3376 | { |
| 3377 | char *area = NULL; | 3377 | char *area = NULL; |
| 3378 | char **address = &area; | 3378 | char **address = &area; |
diff --git a/src/unexelf.c b/src/unexelf.c index 2ac6bbdc06e..0de69a4cabc 100644 --- a/src/unexelf.c +++ b/src/unexelf.c | |||
| @@ -610,7 +610,7 @@ round_up (ElfW(Addr) x, ElfW(Addr) y) | |||
| 610 | if NOERROR is 0; we return -1 if NOERROR is nonzero. */ | 610 | if NOERROR is 0; we return -1 if NOERROR is nonzero. */ |
| 611 | 611 | ||
| 612 | static int | 612 | static int |
| 613 | find_section (char *name, char *section_names, char *file_name, | 613 | find_section (const char *name, char *section_names, char *file_name, |
| 614 | ElfW(Ehdr) *old_file_h, ElfW(Shdr) *old_section_h, int noerror) | 614 | ElfW(Ehdr) *old_file_h, ElfW(Shdr) *old_section_h, int noerror) |
| 615 | { | 615 | { |
| 616 | int idx; | 616 | int idx; |
diff --git a/src/xrdb.c b/src/xrdb.c index 72b9e07738e..e0d948fd3a6 100644 --- a/src/xrdb.c +++ b/src/xrdb.c | |||
| @@ -53,7 +53,7 @@ extern char *getenv (const char *); | |||
| 53 | extern struct passwd *getpwuid (uid_t); | 53 | extern struct passwd *getpwuid (uid_t); |
| 54 | extern struct passwd *getpwnam (const char *); | 54 | extern struct passwd *getpwnam (const char *); |
| 55 | 55 | ||
| 56 | extern char *get_system_name (void); | 56 | extern const char *get_system_name (void); |
| 57 | 57 | ||
| 58 | char *x_get_string_resource (XrmDatabase rdb, const char *name, | 58 | char *x_get_string_resource (XrmDatabase rdb, const char *name, |
| 59 | const char *class); | 59 | const char *class); |
| @@ -438,7 +438,8 @@ get_environ_db (void) | |||
| 438 | { | 438 | { |
| 439 | XrmDatabase db; | 439 | XrmDatabase db; |
| 440 | char *p; | 440 | char *p; |
| 441 | char *path = 0, *home = 0, *host; | 441 | char *path = 0, *home = 0; |
| 442 | const char *host; | ||
| 442 | 443 | ||
| 443 | if ((p = getenv ("XENVIRONMENT")) == NULL) | 444 | if ((p = getenv ("XENVIRONMENT")) == NULL) |
| 444 | { | 445 | { |