ChangeLog: 2008-02-25 Peter Breitenlohner * info/doc.h, info/echo-area.c, info/echo-area.h, info/footnotes.c, info/indices.c, info/info.c, info/info.h, info/infodoc.c, info/infokey.c, info/infomap.c, info/m-x.c, info/nodemenu.c, info/session.c, info/session.h, info/variables.c, info/variables.h, info/window.c, info/window.h: declare constant strings as such and remove many `(char *)' casts -- in particular for `_(...)'. Avoid gcc warnings (for --disable-nls and maybe without). ============================== diff -ur texinfo-4.11.90.orig/info/doc.h texinfo-4.11.90/info/doc.h --- texinfo-4.11.90.orig/info/doc.h 2007-07-01 23:20:29.000000000 +0200 +++ texinfo-4.11.90/info/doc.h 2008-02-25 11:29:43.000000000 +0100 @@ -96,7 +96,7 @@ extern char *pretty_keyname (unsigned char key); extern char *pretty_keyseq (char *keyseq); extern char *where_is (Keymap map, InfoCommand *cmd); -extern char *replace_in_documentation (char *string, int help_is_only_window_p); +extern char *replace_in_documentation (const char *string, int help_is_only_window_p); extern void dump_map_to_message_buffer (char *prefix, Keymap map); #endif /* !DOC_H */ diff -ur texinfo-4.11.90.orig/info/echo-area.c texinfo-4.11.90/info/echo-area.c --- texinfo-4.11.90.orig/info/echo-area.c 2007-12-03 02:38:42.000000000 +0100 +++ texinfo-4.11.90/info/echo-area.c 2008-02-25 13:31:52.000000000 +0100 @@ -44,7 +44,7 @@ /* Variables which hold on to the current state of the input line. */ static char input_line[1 + EA_MAX_INPUT]; -static char *input_line_prompt; +static const char *input_line_prompt; static int input_line_point; static int input_line_beg; static int input_line_end; @@ -159,7 +159,7 @@ /* Set up a new input line with PROMPT. */ static void -initialize_input_line (char *prompt) +initialize_input_line (const char *prompt) { input_line_prompt = prompt; if (prompt) @@ -200,7 +200,7 @@ active window, so that we can restore it when we need to. PROMPT, if non-null, is a prompt to print before reading the line. */ char * -info_read_in_echo_area (WINDOW *window, char *prompt) +info_read_in_echo_area (WINDOW *window, const char *prompt) { char *line; @@ -559,7 +559,7 @@ if (!kill_ring_index) { - inform_in_echo_area ((char *) _("Kill ring is empty")); + inform_in_echo_area (_("Kill ring is empty")); return; } @@ -798,7 +798,7 @@ /* Workhorse for completion readers. If FORCE is non-zero, the user cannot exit unless the line read completes, or is empty. */ char * -info_read_completing_internal (WINDOW *window, char *prompt, +info_read_completing_internal (WINDOW *window, const char *prompt, REFERENCE **completions, int force) { char *line; @@ -864,9 +864,9 @@ if (i == completions_found_index) { if (!completions_found_index) - inform_in_echo_area ((char *) _("No completions")); + inform_in_echo_area (_("No completions")); else - inform_in_echo_area ((char *) _("Not complete")); + inform_in_echo_area (_("Not complete")); continue; } } @@ -893,7 +893,7 @@ /* Read a line in the echo area with completion over COMPLETIONS. */ char * info_read_completing_in_echo_area (WINDOW *window, - char *prompt, REFERENCE **completions) + const char *prompt, REFERENCE **completions) { return (info_read_completing_internal (window, prompt, completions, 1)); } @@ -902,7 +902,7 @@ not requiring it. */ char * info_read_maybe_completing (WINDOW *window, - char *prompt, REFERENCE **completions) + const char *prompt, REFERENCE **completions) { return (info_read_completing_internal (window, prompt, completions, 0)); } @@ -920,11 +920,11 @@ if (!completions_found_index) { terminal_ring_bell (); - inform_in_echo_area ((char *) _("No completions")); + inform_in_echo_area (_("No completions")); } else if ((completions_found_index == 1) && (key != '?')) { - inform_in_echo_area ((char *) _("Sole completion")); + inform_in_echo_area (_("Sole completion")); } else { @@ -933,8 +933,8 @@ initialize_message_buffer (); printf_to_message_buffer (completions_found_index == 1 - ? (char *) _("One completion:\n") - : (char *) _("%d completions:\n"), + ? _("One completion:\n") + : _("%d completions:\n"), (void *) (long) completions_found_index, NULL, NULL); @@ -1216,7 +1216,7 @@ if (!informed_of_lengthy_job && completions_found_index > 100) { informed_of_lengthy_job = 1; - window_message_in_echo_area ((char *) _("Building completions..."), + window_message_in_echo_area (_("Building completions..."), NULL, NULL); } } @@ -1382,7 +1382,7 @@ /* Push and Pop the echo area. */ typedef struct { char *line; - char *prompt; + const char *prompt; REFERENCE **comp_items; int point, beg, end; int must_complete; diff -ur texinfo-4.11.90.orig/info/echo-area.h texinfo-4.11.90/info/echo-area.h --- texinfo-4.11.90.orig/info/echo-area.h 2007-07-01 23:20:29.000000000 +0200 +++ texinfo-4.11.90/info/echo-area.h 2008-02-25 13:31:55.000000000 +0100 @@ -36,25 +36,25 @@ extern void echo_area_inform_of_deleted_window (WINDOW *window); extern void echo_area_prep_read (void); extern VFunction *ea_last_executed_command; -extern char * info_read_completing_internal (WINDOW *window, char *prompt, +extern char * info_read_completing_internal (WINDOW *window, const char *prompt, REFERENCE **completions, int force); /* Read a line of text in the echo area. Return a malloc ()'ed string, or NULL if the user aborted out of this read. WINDOW is the currently active window, so that we can restore it when we need to. PROMPT, if non-null, is a prompt to print before reading the line. */ -extern char *info_read_in_echo_area (WINDOW *window, char *prompt); +extern char *info_read_in_echo_area (WINDOW *window, const char *prompt); /* Read a line in the echo area with completion over COMPLETIONS. Takes arguments of WINDOW, PROMPT, and COMPLETIONS, a REFERENCE **. */ char *info_read_completing_in_echo_area (WINDOW *window, - char *prompt, REFERENCE **completions); + const char *prompt, REFERENCE **completions); /* Read a line in the echo area allowing completion over COMPLETIONS, but not requiring it. Takes arguments of WINDOW, PROMPT, and COMPLETIONS, a REFERENCE **. */ extern char *info_read_maybe_completing (WINDOW *window, - char *prompt, REFERENCE **completions); + const char *prompt, REFERENCE **completions); extern void ea_insert (WINDOW *window, int count, unsigned char key); extern void ea_quoted_insert (WINDOW *window, int count, unsigned char key); diff -ur texinfo-4.11.90.orig/info/footnotes.c texinfo-4.11.90/info/footnotes.c --- texinfo-4.11.90.orig/info/footnotes.c 2007-12-03 02:19:27.000000000 +0100 +++ texinfo-4.11.90/info/footnotes.c 2008-02-25 12:09:38.000000000 +0100 @@ -209,7 +209,7 @@ /* If we are hacking automatic footnotes, and there are footnotes but we couldn't display them, print a message to that effect. */ if (auto_footnotes_p) - inform_in_echo_area ((char *) _("Footnotes could not be displayed")); + inform_in_echo_area (_("Footnotes could not be displayed")); return (FN_UNABLE); } } @@ -256,11 +256,11 @@ switch (result) { case FN_UNFOUND: - info_error ((char *) msg_no_foot_node, NULL, NULL); + info_error (msg_no_foot_node, NULL, NULL); break; case FN_UNABLE: - info_error ((char *) msg_win_too_small, NULL, NULL); + info_error (msg_win_too_small, NULL, NULL); break; } } diff -ur texinfo-4.11.90.orig/info/indices.c texinfo-4.11.90/info/indices.c --- texinfo-4.11.90.orig/info/indices.c 2007-12-03 02:19:27.000000000 +0100 +++ texinfo-4.11.90/info/indices.c 2008-02-25 13:21:47.000000000 +0100 @@ -195,7 +195,7 @@ (FILENAME_CMP (initial_index_filename, fb->filename) != 0)) { info_free_references (index_index); - window_message_in_echo_area ((char *) _("Finding index entries..."), + window_message_in_echo_area (_("Finding index entries..."), NULL, NULL); index_index = info_indices_of_file_buffer (fb); } @@ -203,7 +203,7 @@ /* If there is no index, quit now. */ if (!index_index) { - info_error ((char *) _("No indices found."), NULL, NULL); + info_error (_("No indices found."), NULL, NULL); return; } @@ -213,7 +213,7 @@ line = xstrdup (search_string); else { - line = info_read_maybe_completing (window, (char *) _("Index entry: "), + line = info_read_maybe_completing (window, _("Index entry: "), index_index); window = active_window; @@ -331,14 +331,14 @@ yet. */ if (!index_search) { - info_error ((char *) _("No previous index search string."), NULL, NULL); + info_error (_("No previous index search string."), NULL, NULL); return; } /* If there is no index, that is an error. */ if (!index_index) { - info_error ((char *) _("No index entries."), NULL, NULL); + info_error (_("No index entries."), NULL, NULL); return; } @@ -371,7 +371,7 @@ /* If that failed, print an error. */ if ((i < 0) || (!index_index[i])) { - info_error ((char *) _("No %sindex entries containing `%s'."), + info_error (_("No %sindex entries containing `%s'."), index_offset > 0 ? (char *) _("more ") : "", index_search); return; } @@ -418,7 +418,7 @@ char *format; format = replace_in_documentation - ((char *) _("Found `%s' in %s. (`\\[next-index-match]' tries to find next.)"), + (_("Found `%s' in %s. (`\\[next-index-match]' tries to find next.)"), 0); window_message_in_echo_area (format, match, (char *) name); @@ -432,7 +432,7 @@ if (!node) { - info_error ((char *) msg_cant_file_node, + info_error (msg_cant_file_node, index_index[i]->filename, index_index[i]->nodename); return; } @@ -546,7 +546,7 @@ } if (this_fb && inform) - message_in_echo_area ((char *) _("Scanning indices of `%s'..."), + message_in_echo_area (_("Scanning indices of `%s'..."), files_name, NULL); this_index = info_indices_of_file_buffer (this_fb); @@ -611,7 +611,7 @@ apropos_list = apropos_in_all_indices (string, 0); if (!apropos_list) - info_error ((char *) _(APROPOS_NONE), string, NULL); + info_error (_(APROPOS_NONE), string, NULL); else { register int i; @@ -631,7 +631,7 @@ { char *line; - line = info_read_in_echo_area (window, (char *) _("Index apropos: ")); + line = info_read_in_echo_area (window, _("Index apropos: ")); window = active_window; @@ -651,7 +651,7 @@ apropos_list = apropos_in_all_indices (line, 1); if (!apropos_list) - info_error ((char *) _(APROPOS_NONE), line, NULL); + info_error (_(APROPOS_NONE), line, NULL); else { register int i; @@ -659,7 +659,7 @@ initialize_message_buffer (); printf_to_message_buffer - ((char *) _("\n* Menu: Nodes whose indices contain `%s':\n"), + (_("\n* Menu: Nodes whose indices contain `%s':\n"), line, NULL, NULL); line_buffer = (char *)xmalloc (500); diff -ur texinfo-4.11.90.orig/info/info.c texinfo-4.11.90/info/info.c --- texinfo-4.11.90.orig/info/info.c 2008-02-22 20:18:25.000000000 +0100 +++ texinfo-4.11.90/info/info.c 2008-02-25 12:04:07.000000000 +0100 @@ -365,7 +365,7 @@ if (info_recent_file_error) info_error (info_recent_file_error, NULL, NULL); else - info_error ((char *) msg_cant_find_node, + info_error (msg_cant_find_node, user_nodenames ? user_nodenames[0] : "Top", NULL); xexit (1); } @@ -430,13 +430,13 @@ dump_node_to_file (initial_node, user_output_filename, dump_subnodes); else - info_error ((char *) errstr, errarg1, errarg2); + info_error (errstr, errarg1, errarg2); } else { if (errstr) - begin_info_session_with_error (initial_node, (char *) errstr, + begin_info_session_with_error (initial_node, errstr, errarg1, errarg2); /* If the user specified `--index-search=STRING' or --show-options, start the info session in the node @@ -553,7 +553,7 @@ then the message is printed in the echo area. Otherwise, a message is output to stderr. */ void -info_error (char *format, void *arg1, void *arg2) +info_error (const char *format, void *arg1, void *arg2) { info_error_was_printed = 1; diff -ur texinfo-4.11.90.orig/info/info.h texinfo-4.11.90/info/info.h --- texinfo-4.11.90.orig/info/info.h 2007-07-01 23:20:30.000000000 +0200 +++ texinfo-4.11.90/info/info.h 2008-02-25 13:29:38.000000000 +0100 @@ -125,7 +125,7 @@ /* Print FORMAT with ARG1 and ARG2. If the window system was initialized, then the message is printed in the echo area. Otherwise, a message is output to stderr. */ -extern void info_error (char *format, void *arg1, void *arg2); +extern void info_error (const char *format, void *arg1, void *arg2); extern void add_file_directory_to_path (char *filename); @@ -154,6 +154,6 @@ #endif /* INFOKEY */ /* Found in m-x.c. */ -extern char *read_function_name (char *prompt, WINDOW *window); +extern char *read_function_name (const char *prompt, WINDOW *window); #endif /* !INFO_H */ diff -ur texinfo-4.11.90.orig/info/infodoc.c texinfo-4.11.90/info/infodoc.c --- texinfo-4.11.90.orig/info/infodoc.c 2008-02-22 00:36:16.000000000 +0100 +++ texinfo-4.11.90/info/infodoc.c 2008-02-25 13:29:02.000000000 +0100 @@ -294,7 +294,7 @@ { #ifdef INFOKEY printf_to_message_buffer (replace_in_documentation - ((char *) _(info_internal_help_text[i]), help_is_only_window_p), + (_(info_internal_help_text[i]), help_is_only_window_p), NULL, NULL, NULL); #else /* Don't translate blank lines, gettext outputs the po file @@ -314,15 +314,15 @@ } printf_to_message_buffer ("---------------------\n\n", NULL, NULL, NULL); - printf_to_message_buffer ((char *) _("The current search path is:\n"), + printf_to_message_buffer (_("The current search path is:\n"), NULL, NULL, NULL); printf_to_message_buffer (" %s\n", infopath, NULL, NULL); printf_to_message_buffer ("---------------------\n\n", NULL, NULL, NULL); - printf_to_message_buffer ((char *) _("Commands available in Info windows:\n\n"), + printf_to_message_buffer (_("Commands available in Info windows:\n\n"), NULL, NULL, NULL); dump_map_to_message_buffer ("", info_keymap); printf_to_message_buffer ("---------------------\n\n", NULL, NULL, NULL); - printf_to_message_buffer ((char *) _("Commands available in the echo area:\n\n"), + printf_to_message_buffer (_("Commands available in the echo area:\n\n"), NULL, NULL, NULL); dump_map_to_message_buffer ("", echo_area_keymap); @@ -345,11 +345,11 @@ NULL, NULL, NULL); if (exec_keys && exec_keys[0]) printf_to_message_buffer - ((char *) _("The following commands can only be invoked via %s:\n\n"), + (_("The following commands can only be invoked via %s:\n\n"), exec_keys, NULL, NULL); else printf_to_message_buffer - ((char *) _("The following commands cannot be invoked at all:\n\n"), + (_("The following commands cannot be invoked at all:\n\n"), NULL, NULL, NULL); printed_one_mx = 1; } @@ -359,7 +359,7 @@ exec_keys, function_doc_array[i].func_name, replace_in_documentation (strlen (function_doc_array[i].doc) - ? (char *) _(function_doc_array[i].doc) : "", 0) + ? _(function_doc_array[i].doc) : "", 0) ); } @@ -373,7 +373,7 @@ printf_to_message_buffer ("%s", replace_in_documentation - ((char *) _("--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n"), 0), + (_("--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n"), 0), NULL, NULL); node = message_buffer_to_node (); internal_info_help_node_contents = node->contents; @@ -495,7 +495,7 @@ } else { - info_error ((char *) msg_cant_make_help, NULL, NULL); + info_error (msg_cant_make_help, NULL, NULL); } } @@ -539,7 +539,7 @@ if (info_recent_file_error) info_error (info_recent_file_error, NULL, NULL); else - info_error ((char *) msg_cant_file_node, "Info", nodename); + info_error (msg_cant_file_node, "Info", nodename); } else { @@ -587,7 +587,7 @@ #endif /* !INFOKEY */ - return replace_in_documentation ((strlen (doc) == 0) ? doc : (char *) _(doc), 0); + return replace_in_documentation ((strlen (doc) == 0) ? doc : _(doc), 0); } #if defined (NAMED_FUNCTIONS) @@ -651,7 +651,7 @@ for (;;) { - message_in_echo_area ((char *) _("Describe key: %s"), + message_in_echo_area (_("Describe key: %s"), pretty_keyseq (keys), NULL); keystroke = info_get_input_char (); unmessage_in_echo_area (); @@ -678,7 +678,7 @@ if (map[keystroke].function == (InfoCommand *)NULL) { - message_in_echo_area ((char *) _("%s is undefined."), + message_in_echo_area (_("%s is undefined."), pretty_keyseq (keys), NULL); return; } @@ -707,7 +707,7 @@ if (map[lowerkey].function == (InfoCommand *)NULL) { - message_in_echo_area ((char *) _("%s is undefined."), + message_in_echo_area (_("%s is undefined."), pretty_keyseq (keys), NULL); return; } @@ -888,7 +888,7 @@ /* Replace the names of functions with the key that invokes them. */ char * -replace_in_documentation (char *string, int help_is_only_window_p) +replace_in_documentation (const char *string, int help_is_only_window_p) { unsigned reslen = strlen (string); register int i, start, next; @@ -1155,7 +1155,7 @@ { char *command_name; - command_name = read_function_name ((char *) _("Where is command: "), window); + command_name = read_function_name (_("Where is command: "), window); if (!command_name) { @@ -1177,23 +1177,23 @@ if (!location || !location[0]) { - info_error ((char *) _("`%s' is not on any keys"), + info_error (_("`%s' is not on any keys"), command_name, NULL); } else { if (strstr (location, function_name (command))) window_message_in_echo_area - ((char *) _("%s can only be invoked via %s."), + (_("%s can only be invoked via %s."), command_name, location); else window_message_in_echo_area - ((char *) _("%s can be invoked via %s."), + (_("%s can be invoked via %s."), command_name, location); } } else - info_error ((char *) _("There is no function named `%s'"), + info_error (_("There is no function named `%s'"), command_name, NULL); } diff -ur texinfo-4.11.90.orig/info/infokey.c texinfo-4.11.90/info/infokey.c --- texinfo-4.11.90.orig/info/infokey.c 2008-02-22 20:21:18.000000000 +0100 +++ texinfo-4.11.90/info/infokey.c 2008-02-25 13:36:25.000000000 +0100 @@ -638,7 +638,7 @@ else { syntax_error (filename, lnum, - (char *) _("NUL character (^%c) not permitted"), + _("NUL character (^%c) not permitted"), (void *) (long) c, NULL, NULL, NULL); error = 1; } @@ -662,7 +662,7 @@ rescan = 1; if (alen == 0) { - syntax_error (filename, lnum, (char *) _("missing action name"), + syntax_error (filename, lnum, _("missing action name"), (void *) (long) c, NULL, NULL, NULL); error = 1; } diff -ur texinfo-4.11.90.orig/info/infomap.c texinfo-4.11.90/info/infomap.c --- texinfo-4.11.90.orig/info/infomap.c 2008-02-19 15:58:29.000000000 +0100 +++ texinfo-4.11.90/info/infomap.c 2008-02-25 11:54:03.000000000 +0100 @@ -1505,10 +1505,10 @@ /* Bad file (a valid file must have at least 9 chars, and more than 100 KB is a problem). */ if (len < INFOKEY_NMAGIC + 2) - info_error((char *) _("Ignoring invalid infokey file `%s' - too small"), + info_error(_("Ignoring invalid infokey file `%s' - too small"), filename, NULL); else - info_error((char *) _("Ignoring invalid infokey file `%s' - too big"), + info_error(_("Ignoring invalid infokey file `%s' - too big"), filename, NULL); close(f); free(filename); @@ -1521,7 +1521,7 @@ close(f); if ((unsigned int) nread != len) { - info_error((char *) _("Error reading infokey file `%s' - short read"), + info_error(_("Error reading infokey file `%s' - short read"), filename, NULL); free(buf); free(filename); @@ -1540,7 +1540,7 @@ || buf[len - 1] != INFOKEY_MAGIC_E3 ) { - info_error((char *) _("Invalid infokey file `%s' (bad magic numbers) -- run infokey to update it"), + info_error(_("Invalid infokey file `%s' (bad magic numbers) -- run infokey to update it"), filename, NULL); free(filename); return 0; @@ -1549,7 +1549,7 @@ || strcmp(VERSION, (char *) (buf + 4)) != 0) { info_error - ((char *) _("Your infokey file `%s' is out of date -- run infokey to update it"), + (_("Your infokey file `%s' is out of date -- run infokey to update it"), filename, NULL); free(filename); return 0; @@ -1565,7 +1565,7 @@ n = getint(&p); if (n < 0 || (unsigned int) n > len - 4 - (p - buf)) { - info_error((char *) _("Invalid infokey file `%s' (bad section length) -- run infokey to update it"), + info_error(_("Invalid infokey file `%s' (bad section length) -- run infokey to update it"), filename, NULL); free(filename); return 0; @@ -1586,7 +1586,7 @@ user_vars_len = n; break; default: - info_error((char *) _("Invalid infokey file `%s' (bad section code) -- run infokey to update it"), + info_error(_("Invalid infokey file `%s' (bad section code) -- run infokey to update it"), filename, NULL); free(filename); return 0; @@ -1721,7 +1721,7 @@ } } if (state != getseq) - info_error((char *) _("Bad data in infokey file -- some key bindings ignored"), + info_error(_("Bad data in infokey file -- some key bindings ignored"), NULL, NULL); return !stop; } @@ -1771,7 +1771,7 @@ } } if (state != getvar) - info_error((char *) _("Bad data in infokey file -- some var settings ignored"), + info_error(_("Bad data in infokey file -- some var settings ignored"), NULL, NULL); } diff -ur texinfo-4.11.90.orig/info/m-x.c texinfo-4.11.90/info/m-x.c --- texinfo-4.11.90.orig/info/m-x.c 2007-12-03 02:19:27.000000000 +0100 +++ texinfo-4.11.90/info/m-x.c 2008-02-25 13:29:31.000000000 +0100 @@ -32,7 +32,7 @@ name. A return value of NULL indicates that no function name could be read. */ char * -read_function_name (char *prompt, WINDOW *window) +read_function_name (const char *prompt, WINDOW *window) { register int i; char *line; @@ -69,7 +69,7 @@ { char *line; - line = read_function_name ((char *) _("Describe command: "), window); + line = read_function_name (_("Describe command: "), window); if (!line) { @@ -136,7 +136,7 @@ (strncmp (line, "echo-area-", 10) == 0)) { free (line); - info_error ((char *) _("Cannot execute an `echo-area' command here."), + info_error (_("Cannot execute an `echo-area' command here."), NULL, NULL); return; } @@ -150,7 +150,7 @@ if (InfoFunction(command)) (*InfoFunction(command)) (active_window, count, 0); else - info_error ((char *) _("Undefined command: %s"), line, NULL); + info_error (_("Undefined command: %s"), line, NULL); } } diff -ur texinfo-4.11.90.orig/info/nodemenu.c texinfo-4.11.90/info/nodemenu.c --- texinfo-4.11.90.orig/info/nodemenu.c 2007-12-03 02:38:42.000000000 +0100 +++ texinfo-4.11.90/info/nodemenu.c 2008-02-25 13:31:15.000000000 +0100 @@ -198,7 +198,7 @@ printf_to_message_buffer ("%s", replace_in_documentation - ((char *) _("Here is the menu of nodes you have recently visited.\n\ + (_("Here is the menu of nodes you have recently visited.\n\ Select one from this menu, or use `\\[history-node]' in another window.\n"), 0), NULL, NULL); @@ -313,7 +313,7 @@ line = info_read_completing_in_echo_area (window, - (char *) _("Select visited node: "), menu); + _("Select visited node: "), menu); window = active_window; @@ -333,7 +333,7 @@ entry = info_get_labeled_reference (line, menu); if (!entry) - info_error ((char *) _("The reference disappeared! (%s)."), line, NULL); + info_error (_("The reference disappeared! (%s)."), line, NULL); else info_select_reference (window, entry); } diff -ur texinfo-4.11.90.orig/info/session.c texinfo-4.11.90/info/session.c --- texinfo-4.11.90.orig/info/session.c 2008-02-19 15:58:29.000000000 +0100 +++ texinfo-4.11.90/info/session.c 2008-02-25 13:34:04.000000000 +0100 @@ -112,7 +112,7 @@ if (!largest) { display_update_display (windows); - info_error ((char *) msg_cant_find_window, NULL, NULL); + info_error (msg_cant_find_window, NULL, NULL); info_session (); xexit (0); } @@ -127,7 +127,7 @@ else { display_update_display (windows); - info_error ((char *) msg_win_too_small, NULL, NULL); + info_error (msg_win_too_small, NULL, NULL); info_session (); xexit (0); } @@ -139,7 +139,7 @@ /* Start an info session with INITIAL_NODE, and an error message in the echo area made from FORMAT and ARG. */ void -begin_info_session_with_error (NODE *initial_node, char *format, +begin_info_session_with_error (NODE *initial_node, const char *format, void *arg1, void *arg2) { initialize_info_session (initial_node, 1); @@ -161,7 +161,7 @@ char *format; format = replace_in_documentation - ((char *) _("Welcome to Info version %s. Type \\[get-help-window] for help, \\[menu-item] for menu item."), + (_("Welcome to Info version %s. Type \\[get-help-window] for help, \\[menu-item] for menu item."), 0); window_message_in_echo_area (format, VERSION, NULL); @@ -268,7 +268,7 @@ if (!term_name) term_name = "dumb"; - info_error ((char *) msg_term_too_dumb, term_name, NULL); + info_error (msg_term_too_dumb, term_name, NULL); xexit (1); } @@ -600,7 +600,7 @@ { if (old == -1) { - info_error ((char *) msg_cant_find_point, NULL, NULL); + info_error (msg_cant_find_point, NULL, NULL); } else { @@ -976,14 +976,14 @@ switch (behaviour) { case IS_PageOnly: - info_error ((char *) msg_at_node_bottom, NULL, NULL); + info_error (msg_at_node_bottom, NULL, NULL); return 1; case IS_NextOnly: info_next_label_of_node (window->node); if (!info_parsed_nodename && !info_parsed_filename) { - info_error ((char *) msg_no_pointer, (char *) _("Next"), NULL); + info_error (msg_no_pointer, (char *) _("Next"), NULL); return 1; } else @@ -1103,7 +1103,7 @@ window->point = info_win->points[old_current]; recalculate_line_starts (window); window->flags |= W_UpdateWindow; - info_error ((char *) _("No more nodes within this document."), + info_error (_("No more nodes within this document."), NULL, NULL); return 1; } @@ -1122,14 +1122,14 @@ switch (behaviour) { case IS_PageOnly: - info_error ((char *) msg_at_node_top, NULL, NULL); + info_error (msg_at_node_top, NULL, NULL); return 1; case IS_NextOnly: info_prev_label_of_node (window->node); if (!info_parsed_nodename && !info_parsed_filename) { - info_error ((char *) _("No `Prev' for this node."), NULL, NULL); + info_error (_("No `Prev' for this node."), NULL, NULL); return 1; } else @@ -1148,7 +1148,7 @@ if (!info_parsed_nodename && (!info_parsed_filename || is_dir_name (info_parsed_filename))) { - info_error ((char *) + info_error ( _("No `Prev' or `Up' for this node within this document."), NULL, NULL); return 1; @@ -1501,7 +1501,7 @@ /* If no other window, error now. */ if (!windows->next && !echo_area_is_active) { - info_error ((char *) msg_one_window, NULL, NULL); + info_error (msg_one_window, NULL, NULL); return; } @@ -1541,7 +1541,7 @@ if (!windows->next && !echo_area_is_active) { - info_error ((char *) msg_one_window, NULL, NULL); + info_error (msg_one_window, NULL, NULL); return; } @@ -1597,7 +1597,7 @@ if (!split) { - info_error ((char *) msg_win_too_small, NULL, NULL); + info_error (msg_win_too_small, NULL, NULL); } else { @@ -1665,11 +1665,11 @@ { if (!windows->next) { - info_error ((char *) msg_cant_kill_last, NULL, NULL); + info_error (msg_cant_kill_last, NULL, NULL); } else if (window->flags & W_WindowIsPerm) { - info_error ((char *) _("Cannot delete a permanent window"), NULL, NULL); + info_error (_("Cannot delete a permanent window"), NULL, NULL); } else { @@ -1754,7 +1754,7 @@ /* If only one window, give up. */ if (!windows->next) { - info_error ((char *) msg_one_window, NULL, NULL); + info_error (msg_one_window, NULL, NULL); return; } @@ -1885,7 +1885,7 @@ if (file_system_error) info_error (file_system_error, NULL, NULL); else - info_error ((char *) msg_cant_find_node, nodename, NULL); + info_error (msg_cant_find_node, nodename, NULL); } maybe_free (file_system_error); @@ -1961,7 +1961,7 @@ if (info_recent_file_error) info_error (info_recent_file_error, NULL, NULL); else - info_error ((char *) msg_cant_file_node, filename, nodename); + info_error (msg_cant_file_node, filename, nodename); } free (filename); @@ -1969,7 +1969,7 @@ } else { - info_error ((char *) msg_no_pointer, label, NULL); + info_error (msg_no_pointer, label, NULL); } } @@ -2025,7 +2025,7 @@ } if (!node) - info_error ((char *) _("This window has no additional nodes"), NULL, NULL); + info_error (_("This window has no additional nodes"), NULL, NULL); else info_set_node_of_window (1, window, node); } @@ -2058,7 +2058,7 @@ } if (!node) - info_error ((char *) _("This window has no additional nodes"), NULL, NULL); + info_error (_("This window has no additional nodes"), NULL, NULL); else info_set_node_of_window (1, window, node); } @@ -2080,7 +2080,7 @@ if (!menu) { - info_error ((char *) msg_no_menu_node, NULL, NULL); + info_error (msg_no_menu_node, NULL, NULL); return; } @@ -2104,7 +2104,7 @@ info_next_line (window, menu[i]->line_number - 1, key); } else - info_error ((char *) _("There aren't %d items in this menu."), + info_error (_("There aren't %d items in this menu."), (void *) (long) item, NULL); info_free_references (menu); @@ -2193,9 +2193,9 @@ if (!menu) { if (builder == info_menu_of_node) - info_error ((char *) msg_no_menu_node, NULL, NULL); + info_error (msg_no_menu_node, NULL, NULL); else - info_error ((char *) msg_no_xref_node, NULL, NULL); + info_error (msg_no_xref_node, NULL, NULL); return; } @@ -2391,7 +2391,7 @@ } if (!entry && defentry) - info_error ((char *) _("The reference disappeared! (%s)."), line, NULL); + info_error (_("The reference disappeared! (%s)."), line, NULL); else { NODE *orig = window->node; @@ -2469,7 +2469,7 @@ position = search (INFO_MENU_LABEL, &binding); if (position == -1) - info_error ((char *) msg_no_menu_node, NULL, NULL); + info_error (msg_no_menu_node, NULL, NULL); else { window->point = position; @@ -2488,7 +2488,7 @@ menu = info_menu_of_node (window->node); if (!menu) - info_error ((char *) msg_no_menu_node, NULL, NULL); + info_error (msg_no_menu_node, NULL, NULL); for (i = 0; (!info_error_was_printed) && (entry = menu[i]); i++) { @@ -2498,7 +2498,7 @@ window_tile_windows (TILE_INTERNALS); if (!new) - info_error ((char *) msg_win_too_small, NULL, NULL); + info_error (msg_win_too_small, NULL, NULL); else { active_window = new; @@ -2563,12 +2563,12 @@ } } } - line = info_read_maybe_completing (window, (char *) _("Goto node: "), + line = info_read_maybe_completing (window, _("Goto node: "), items); info_free_references (items); } #else /* !GOTO_COMPLETES */ - line = info_read_in_echo_area (window, (char *) _("Goto node: ")); + line = info_read_in_echo_area (window, _("Goto node: ")); #endif /* !GOTO_COMPLETES */ /* If the user aborted, quit now. */ @@ -2760,7 +2760,7 @@ DECLARE_INFO_COMMAND (info_menu_sequence, _("Read a list of menus starting from dir and follow them")) { - char *line = info_read_in_echo_area (window, (char *) _("Follow menus: ")); + char *line = info_read_in_echo_area (window, _("Follow menus: ")); /* If the user aborted, quit now. */ if (!line) @@ -2793,7 +2793,7 @@ /* If we still cannot find the starting point, give up. We cannot allow a NULL pointer inside info_follow_menus. */ if (!dir_node) - info_error ((char *) msg_cant_find_node, "Top", NULL); + info_error (msg_cant_find_node, "Top", NULL); else node = info_follow_menus (dir_node, nodes, &errstr, &errarg1, &errarg2); @@ -2801,7 +2801,7 @@ if (!errstr) info_set_node_of_window (1, window, node); else - info_error ((char *) errstr, errarg1, errarg2); + info_error (errstr, errarg1, errarg2); } free (line); @@ -2985,7 +2985,7 @@ from the Top node. */ top_node = info_get_node (file_name, NULL); if (!top_node) - info_error ((char *) msg_cant_find_node, "Top", NULL); + info_error (msg_cant_find_node, "Top", NULL); info_intuit_options_node (window, top_node, program_name); free (line); @@ -2997,7 +2997,7 @@ { char *line; - line = info_read_in_echo_area (window, (char *) _("Get Manpage: ")); + line = info_read_in_echo_area (window, _("Get Manpage: ")); if (!line) { @@ -3104,7 +3104,7 @@ if (!info_win) { if (*nodename) - info_error ((char *) _("Cannot kill node `%s'"), nodename, NULL); + info_error (_("Cannot kill node `%s'"), nodename, NULL); else window_clear_echo_area (); @@ -3114,7 +3114,7 @@ /* If there are no more nodes left anywhere to view, complain and exit. */ if (info_windows_index == 1 && info_windows[0]->nodes_index == 1) { - info_error ((char *) _("Cannot kill the last node"), NULL, NULL); + info_error (_("Cannot kill the last node"), NULL, NULL); return; } @@ -3218,7 +3218,7 @@ { char *line; - line = info_read_in_echo_area (window, (char *) _("Find file: ")); + line = info_read_in_echo_area (window, _("Find file: ")); if (!line) { info_abort_key (active_window, 1, 0); @@ -3235,7 +3235,7 @@ if (info_recent_file_error) info_error (info_recent_file_error, NULL, NULL); else - info_error ((char *) _("Cannot find `%s'."), line, NULL); + info_error (_("Cannot find `%s'."), line, NULL); } else info_set_node_of_window (1, window, node); @@ -3278,7 +3278,7 @@ if (!output_stream) { - info_error ((char *) _("Could not create output file `%s'."), + info_error (_("Could not create output file `%s'."), output_filename, NULL); return; } @@ -3292,7 +3292,7 @@ fclose (output_stream); #if defined (VERBOSE_NODE_DUMPING) - info_error ((char *) _("Done."), NULL, NULL); + info_error (_("Done."), NULL, NULL); #endif /* VERBOSE_NODE_DUMPING */ } @@ -3326,11 +3326,11 @@ else { if (filename && *nodename != '(') - info_error ((char *) msg_cant_file_node, + info_error (msg_cant_file_node, filename_non_directory (filename), nodename); else - info_error ((char *) msg_cant_find_node, nodename, NULL); + info_error (msg_cant_find_node, nodename, NULL); } return; } @@ -3347,7 +3347,7 @@ #if defined (VERBOSE_NODE_DUMPING) /* Maybe we should print some information about the node being output. */ - info_error ((char *) _("Writing node %s..."), node_printed_rep (node), NULL); + info_error (_("Writing node %s..."), node_printed_rep (node), NULL); #endif /* VERBOSE_NODE_DUMPING */ write_node_to_stream (node, stream); @@ -3396,7 +3396,7 @@ if (!output_stream) { - info_error ((char *) _("Could not create output file `%s'."), filename, + info_error (_("Could not create output file `%s'."), filename, NULL); return; } @@ -3414,7 +3414,7 @@ fclose (output_stream); #if defined (VERBOSE_NODE_DUMPING) - info_error ((char *) _("Done."), NULL, NULL); + info_error (_("Done."), NULL, NULL); #endif /* VERBOSE_NODE_DUMPING */ } @@ -3458,13 +3458,13 @@ if (!printer_pipe) { - info_error ((char *) _("Cannot open pipe to `%s'."), print_command, NULL); + info_error (_("Cannot open pipe to `%s'."), print_command, NULL); return; } #if defined (VERBOSE_NODE_DUMPING) /* Maybe we should print some information about the node being output. */ - info_error ((char *) _("Printing node %s..."), node_printed_rep (node), NULL); + info_error (_("Printing node %s..."), node_printed_rep (node), NULL); #endif /* VERBOSE_NODE_DUMPING */ write_node_to_stream (node, printer_pipe); @@ -3474,7 +3474,7 @@ fclose (printer_pipe); #if defined (VERBOSE_NODE_DUMPING) - info_error ((char *) _("Done."), NULL, NULL); + info_error (_("Done."), NULL, NULL); #endif /* VERBOSE_NODE_DUMPING */ } @@ -3696,7 +3696,7 @@ if (!echo_area_is_active && (last_subfile != tag->filename)) { window_message_in_echo_area - ((char *) _("Searching subfile %s ..."), + (_("Searching subfile %s ..."), filename_non_directory (tag->filename), NULL); last_subfile = tag->filename; @@ -3712,7 +3712,7 @@ if (info_recent_file_error) info_error (info_recent_file_error, NULL, NULL); else - info_error ((char *) msg_cant_file_node, + info_error (msg_cant_file_node, filename_non_directory (file_buffer->filename), tag->nodename); } @@ -3847,7 +3847,7 @@ active_window, direction, case_sensitive); if (result != 0 && !info_error_was_printed) - info_error ((char *) _("Search failed."), NULL, NULL); + info_error (_("Search failed."), NULL, NULL); else if (old_pagetop != active_window->pagetop) { int new_pagetop; @@ -3868,7 +3868,7 @@ _("Repeat last search in the same direction")) { if (!last_search_direction) - info_error ((char *) _("No previous search string"), NULL, NULL); + info_error (_("No previous search string"), NULL, NULL); else info_search_1 (window, last_search_direction * count, key, last_search_case_sensitive, 0); @@ -3878,7 +3878,7 @@ _("Repeat last search in the reverse direction")) { if (!last_search_direction) - info_error ((char *) _("No previous search string"), NULL, NULL); + info_error (_("No previous search string"), NULL, NULL); else info_search_1 (window, -last_search_direction * count, key, last_search_case_sensitive, 0); @@ -4418,7 +4418,7 @@ if (firstmenu == -1 && firstxref == -1) { - info_error ((char *) msg_no_xref_node, NULL, NULL); + info_error (msg_no_xref_node, NULL, NULL); use_regex = save_use_regex; return cursor_movement_scrolls_p; } @@ -4565,7 +4565,7 @@ do it. */ if (!info_error_rings_bell_p) terminal_ring_bell (); - info_error ((char *) _("Quit"), NULL, NULL); + info_error (_("Quit"), NULL, NULL); info_initialize_numeric_arg (); info_clear_pending_input (); @@ -4667,7 +4667,7 @@ rep = pretty_keyseq (keyseq); if (!echo_area_is_active) - info_error ((char *) _("Unknown command (%s)."), rep, NULL); + info_error (_("Unknown command (%s)."), rep, NULL); else { char *temp = xmalloc (1 + strlen (rep) + strlen (_("\"%s\" is invalid"))); diff -ur texinfo-4.11.90.orig/info/session.h texinfo-4.11.90/info/session.h --- texinfo-4.11.90.orig/info/session.h 2007-12-17 20:12:11.000000000 +0100 +++ texinfo-4.11.90/info/session.h 2008-02-25 12:03:20.000000000 +0100 @@ -109,7 +109,7 @@ char **nodenames); extern void begin_info_session (NODE *initial_node); extern void begin_info_session_with_error (NODE *initial_node, - char *format, void *arg1, void *arg2); + const char *format, void *arg1, void *arg2); extern void info_session (void); extern void initialize_info_session (NODE *node, int clear_screen); extern void info_read_and_dispatch (void); diff -ur texinfo-4.11.90.orig/info/variables.c texinfo-4.11.90/info/variables.c --- texinfo-4.11.90.orig/info/variables.c 2007-12-03 02:19:27.000000000 +0100 +++ texinfo-4.11.90/info/variables.c 2008-02-25 12:14:24.000000000 +0100 @@ -86,7 +86,7 @@ char *description; /* Get the variable's name. */ - var = read_variable_name ((char *) _("Describe variable: "), window); + var = read_variable_name (_("Describe variable: "), window); if (!var) return; @@ -111,7 +111,7 @@ char *line; /* Get the variable's name and value. */ - var = read_variable_name ((char *) _("Set variable: "), window); + var = read_variable_name (_("Set variable: "), window); if (!var) return; @@ -210,7 +210,7 @@ address of a VARIABLE_ALIST member. A return value of NULL indicates that no variable could be read. */ VARIABLE_ALIST * -read_variable_name (char *prompt, WINDOW *window) +read_variable_name (const char *prompt, WINDOW *window) { register int i; char *line; diff -ur texinfo-4.11.90.orig/info/variables.h texinfo-4.11.90/info/variables.h --- texinfo-4.11.90.orig/info/variables.h 2007-08-07 10:24:46.000000000 +0200 +++ texinfo-4.11.90/info/variables.h 2008-02-25 12:14:29.000000000 +0100 @@ -41,7 +41,7 @@ /* Read the name of an Info variable in the echo area and return the address of a VARIABLE_ALIST member. A return value of NULL indicates that no variable could be read. */ -extern VARIABLE_ALIST *read_variable_name (char *prompt, WINDOW *window); +extern VARIABLE_ALIST *read_variable_name (const char *prompt, WINDOW *window); /* Make an array of REFERENCE which actually contains the names of the variables available in Info. */ diff -ur texinfo-4.11.90.orig/info/window.c texinfo-4.11.90/info/window.c --- texinfo-4.11.90.orig/info/window.c 2008-02-19 15:58:29.000000000 +0100 +++ texinfo-4.11.90/info/window.c 2008-02-25 11:41:41.000000000 +0100 @@ -1269,7 +1269,7 @@ printf () hair is present. The message appears immediately. If there was already a message appearing in the echo area, it is removed. */ void -window_message_in_echo_area (char *format, void *arg1, void *arg2) +window_message_in_echo_area (const char *format, void *arg1, void *arg2) { free_echo_area (); echo_area_node = build_message_node (format, arg1, arg2); @@ -1286,7 +1286,7 @@ static int old_echo_area_nodes_slots = 0; void -message_in_echo_area (char *format, void *arg1, void *arg2) +message_in_echo_area (const char *format, void *arg1, void *arg2) { if (echo_area_node) { @@ -1336,7 +1336,7 @@ /* Format MESSAGE_BUFFER with the results of printing FORMAT with ARG1 and ARG2. */ static void -build_message_buffer (char *format, void *arg1, void *arg2, void *arg3) +build_message_buffer (const char *format, void *arg1, void *arg2, void *arg3) { register int i, len; void *args[3]; @@ -1360,7 +1360,7 @@ else { char c; - char *fmt_start = format + i; + const char *fmt_start = format + i; char *fmt; int fmt_len, formatted_len; int paramed = 0; @@ -1483,7 +1483,7 @@ /* Build a new node which has FORMAT printed with ARG1 and ARG2 as the contents. */ NODE * -build_message_node (char *format, void *arg1, void *arg2) +build_message_node (const char *format, void *arg1, void *arg2) { NODE *node; @@ -1525,7 +1525,7 @@ /* Print FORMAT with ARG1,2 to the end of the current message buffer. */ void -printf_to_message_buffer (char *format, void *arg1, void *arg2, void *arg3) +printf_to_message_buffer (const char *format, void *arg1, void *arg2, void *arg3) { build_message_buffer (format, arg1, arg2, arg3); } diff -ur texinfo-4.11.90.orig/info/window.h texinfo-4.11.90/info/window.h --- texinfo-4.11.90.orig/info/window.h 2007-07-01 23:20:31.000000000 +0200 +++ texinfo-4.11.90/info/window.h 2008-02-25 11:41:32.000000000 +0100 @@ -166,13 +166,13 @@ /* Build a new node which has FORMAT printed with ARG1 and ARG2 as the contents. */ -extern NODE *build_message_node (char *format, void *arg1, void *arg2); +extern NODE *build_message_node (const char *format, void *arg1, void *arg2); /* Useful functions can be called from outside of window.c. */ extern void initialize_message_buffer (void); /* Print FORMAT with ARG1,2 to the end of the current message buffer. */ -extern void printf_to_message_buffer (char *format, void *arg1, void *arg2, +extern void printf_to_message_buffer (const char *format, void *arg1, void *arg2, void *arg3); /* Convert the contents of the message buffer to a node. */ @@ -188,13 +188,13 @@ The arguments are treated similar to printf () arguments, but not all of printf () hair is present. The message appears immediately. If there was already a message appearing in the echo area, it is removed. */ -extern void window_message_in_echo_area (char *format, void *arg1, void *arg2); +extern void window_message_in_echo_area (const char *format, void *arg1, void *arg2); /* Place a temporary message in the echo area built from FORMAT, ARG1 and ARG2. The message appears immediately, but does not destroy any existing message. A future call to unmessage_in_echo_area () restores the old contents. */ -extern void message_in_echo_area (char *format, void *arg1, void *arg2); +extern void message_in_echo_area (const char *format, void *arg1, void *arg2); extern void unmessage_in_echo_area (void); /* Clear the echo area, removing any message that is already present.