diff options
author | Jan D <jan.h.d@swipnet.se> | 2010-08-11 10:20:34 +0200 |
---|---|---|
committer | Jan D <jan.h.d@swipnet.se> | 2010-08-11 10:20:34 +0200 |
commit | 988e88ab11f71fd726ce237c9118f3c415323161 (patch) | |
tree | 4fcd0e485fa42f8e20ba78d826958d73e1d376a9 /lib-src/ebrowse.c | |
parent | 97eedd1b1f3b5a3b9863093f297334c3668e4e83 (diff) | |
download | emacs-988e88ab11f71fd726ce237c9118f3c415323161.tar.gz |
Fix warnings produced by compiling with -Wwrite_strings (i.e. use const char *).
* b2m.c (concat, fatal): Use const char*.
(main): Don't assign labels a string literal.
* ebrowse.c (struct member): filename, def_filename is const.
(struct sym): filename, sfilename is const.
(struct kw): name is const.
(add_sym, yyerror, token_string, insert_keyword, main): Use const char*.
* emacsclient.c (message, sock_err_message, send_to_emacs)
(quote_argument, set_local_socket)
(start_daemon_and_retry_set_socket): Use const char*.
* etags.c (compressor, language, Ada_suffix, Ada_help, Asm_suffixes)
(Asm_help, default_C_suffixes, default_C_help, Cplusplus_suffixes)
(Cplusplus_help, Cjava_suffixes, Cobol_suffixes, Cstar_suffixes)
(Erlang_suffixes, Erlang_help, Forth_suffixes, Forth_help)
(Fortran_suffixes, Fortran_help, HTML_suffixes, HTML_help)
(Lisp_suffixes, Lisp_help, Lua_suffixes, Lua_help)
(Makefile_filenames, Makefile_help, Objc_suffixes, Objc_help)
(Pascal_suffixes, Pascal_help, Perl_suffixes, Perl_interpreters)
(Perl_help, PHP_suffixes, PHP_help, plain_C_suffixses, PS_suffixes)
(PS_help, Prolog_suffixes, Prolog_help, Python_suffixes, Python_help)
(Scheme_suffixes, Scheme_help, TeX_suffixes, TeX_help, Texinfo_suffixes)
(Texinfo_help, Yacc_suffixes, Yacc_help, auto_help, none_help)
(no_lang_help, print_language_names)
(get_language_from_interpreter, get_language_from_filename)
(init, make_tag, struct C_stab_entry, write_classname, TEX_defenv)
(TEX_decode_env, nocase_tail, savestr, savenstr, fatal, pfatal)
(concat): Use const char*.
* make-docfile.c (error, fatal, scan_c_file, scan_lisp_file): Use
const char *.
* movemail.c (fatal, error, concat): Use const char *.
* pop.c (pop_multi_first, socket_connection, sendline): Use conat char*.
* pop.h (pop_multi_first): Use const char *.
(_ARGS): Remove.
* sorted-doc.c (error, fatal, states): Use const char *.
* update-game-score.c (get_prefix, write_scores, main): Use const char*.
Diffstat (limited to 'lib-src/ebrowse.c')
-rw-r--r-- | lib-src/ebrowse.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index 40e72939429..1fcbb8662f5 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c @@ -249,10 +249,10 @@ struct member int vis; /* Visibility (public, ...). */ int flags; /* See F_* above. */ char *regexp; /* Matching regular expression. */ - char *filename; /* Don't free this shared string. */ + const char *filename; /* Don't free this shared string. */ int pos; /* Buffer position of occurrence. */ char *def_regexp; /* Regular expression matching definition. */ - char *def_filename; /* File name of definition. */ + const char *def_filename; /* File name of definition. */ int def_pos; /* Buffer position of definition. */ char name[1]; /* Member name. */ }; @@ -294,8 +294,8 @@ struct sym struct member *types; /* List of local types. */ char *regexp; /* Matching regular expression. */ int pos; /* Buffer position. */ - char *filename; /* File in which it can be found. */ - char *sfilename; /* File in which members can be found. */ + const char *filename; /* File in which it can be found. */ + const char *sfilename; /* File in which members can be found. */ struct sym *namesp; /* Namespace in which defined. . */ char name[1]; /* Name of the class. */ }; @@ -353,7 +353,7 @@ int yyline; /* The name of the current input file. */ -char *filename; +const char *filename; /* Three character class vectors, and macros to test membership of characters. */ @@ -444,7 +444,7 @@ int tk = -1; struct kw { - char *name; /* Spelling. */ + const char *name; /* Spelling. */ int tk; /* Token value. */ struct kw *next; /* Next in collision chain. */ }; @@ -470,10 +470,10 @@ struct search_path *search_path_tail; int yylex (void); void yyparse (void); void re_init_parser (void); -char *token_string (int); +const char *token_string (int); char *matching_regexp (void); void init_sym (void); -struct sym *add_sym (char *, struct sym *); +struct sym *add_sym (const char *, struct sym *); void add_link (struct sym *, struct sym *); void add_member_defn (struct sym *, char *, char *, int, unsigned, int, int, int); @@ -489,7 +489,7 @@ void mark_inherited_virtual (void); void leave_namespace (void); void enter_namespace (char *); void register_namespace_alias (char *, struct link *); -void insert_keyword (char *, int); +void insert_keyword (const char *, int); void re_init_scanner (void); void init_scanner (void); void process_file (char *); @@ -517,7 +517,7 @@ struct sym *parse_classname (void); struct sym *parse_qualified_ident_or_type (char **); void parse_qualified_param_ident_or_type (char **); int globals (int); -void yyerror (char *, char *); +void yyerror (const char *, const char *); void usage (int) NO_RETURN; void version (void) NO_RETURN; @@ -531,7 +531,7 @@ void version (void) NO_RETURN; name and line number. */ void -yyerror (char *format, char *s) +yyerror (const char *format, const char *s) { fprintf (stderr, "%s:%d: ", filename, yyline); fprintf (stderr, format, s); @@ -605,11 +605,11 @@ init_sym (void) create a new symbol and set it to default values. */ struct sym * -add_sym (char *name, struct sym *nested_in_class) +add_sym (const char *name, struct sym *nested_in_class) { struct sym *sym; unsigned h; - char *s; + const char *s; struct sym *scope = nested_in_class ? nested_in_class : current_namespace; for (s = name, h = 0; *s; ++s) @@ -1975,7 +1975,7 @@ matching_regexp (void) /* Return a printable representation of token T. */ -char * +const char * token_string (int t) { static char b[3]; @@ -2111,9 +2111,9 @@ re_init_scanner (void) table. */ void -insert_keyword (char *name, int tk) +insert_keyword (const char *name, int tk) { - char *s; + const char *s; unsigned h = 0; struct kw *k = (struct kw *) xmalloc (sizeof *k); @@ -2839,7 +2839,7 @@ operator_name (int *sc) { static int id_size = 0; static char *id = NULL; - char *s; + const char *s; int len; MATCH (); @@ -3680,7 +3680,7 @@ main (int argc, char **argv) { int i; int any_inputfiles = 0; - static char *out_filename = DEFAULT_OUTFILE; + static const char *out_filename = DEFAULT_OUTFILE; static char **input_filenames = NULL; static int input_filenames_size = 0; static int n_input_files; |