Mercurial > emacs
comparison src/term.c @ 109726:64732fa6188a
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.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Mon, 09 Aug 2010 02:35:21 -0700 |
parents | b6bdd59e60ff |
children | b2b005d54ebb |
comparison
equal
deleted
inserted
replaced
109723:3783b558402b | 109726:64732fa6188a |
---|---|
1085 | 1085 |
1086 /* Compute cost of sending "str", in characters, | 1086 /* Compute cost of sending "str", in characters, |
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) |
1094 tputs (str, 0, evalcost); | 1094 tputs (str, 0, evalcost); |
1095 return cost; | 1095 return cost; |
1097 | 1097 |
1098 /* Compute cost of sending "str", in characters, | 1098 /* Compute cost of sending "str", in characters, |
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) |
1106 tputs (str, 1, evalcost); | 1106 tputs (str, 1, evalcost); |
1107 return cost; | 1107 return cost; |
1109 | 1109 |
1110 /* Compute per line amount of line-dependent padding, | 1110 /* Compute per line amount of line-dependent padding, |
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) |
1118 tputs (str, 0, evalcost); | 1118 tputs (str, 0, evalcost); |
1119 cost = - cost; | 1119 cost = - cost; |
2299 This function ignores suspended devices. | 2299 This function ignores suspended devices. |
2300 | 2300 |
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 |
2308 if (!name) | 2308 if (!name) |
2309 abort (); | 2309 abort (); |
3370 TERMINAL_TYPE is the termcap type of the device, e.g. "vt100". | 3370 TERMINAL_TYPE is the termcap type of the device, e.g. "vt100". |
3371 | 3371 |
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; |
3379 int buffer_size = 4096; | 3379 int buffer_size = 4096; |
3380 register char *p = NULL; | 3380 register char *p = NULL; |