diff --git a/src/builtin.h b/src/builtin.h index 359dd40be..d6774088c 100644 --- a/src/builtin.h +++ b/src/builtin.h @@ -80,15 +80,15 @@ enum { COMMAND_NOT_BUILTIN, BUILTIN_REGULAR, BUILTIN_FUNCTION }; void builtin_init(); bool builtin_exists(const wcstring &cmd); -proc_status_t builtin_run(parser_t &parser, int job_pgrp, wchar_t **argv, io_streams_t &streams); +proc_status_t builtin_run(parser_t &parser, int job_pgid, wchar_t **argv, io_streams_t &streams); wcstring_list_t builtin_get_names(); void builtin_get_names(std::vector *list); -const wchar_t *builtin_get_desc(const wcstring &b); +const wchar_t *builtin_get_desc(const wcstring &name); wcstring builtin_help_get(parser_t &parser, const wchar_t *cmd); -void builtin_print_help(parser_t &parser, io_streams_t &streams, const wchar_t *cmd, +void builtin_print_help(parser_t &parser, io_streams_t &streams, const wchar_t *name, wcstring *error_message = nullptr); int builtin_count_args(const wchar_t *const *argv); diff --git a/src/builtin_printf.cpp b/src/builtin_printf.cpp index e61250eff..e634d74e5 100644 --- a/src/builtin_printf.cpp +++ b/src/builtin_printf.cpp @@ -92,7 +92,7 @@ struct builtin_printf_state_t { int print_formatted(const wchar_t *format, int argc, wchar_t **argv); void nonfatal_error(const wchar_t *fmt, ...); - void fatal_error(const wchar_t *format, ...); + void fatal_error(const wchar_t *fmt, ...); long print_esc(const wchar_t *escstart, bool octal_0); void print_esc_string(const wchar_t *str); diff --git a/src/color.h b/src/color.h index a53d79bf2..ed3e67f30 100644 --- a/src/color.h +++ b/src/color.h @@ -35,10 +35,10 @@ class rgb_color_t { } data; /// Try parsing a special color name like "normal". - bool try_parse_special(const wcstring &str); + bool try_parse_special(const wcstring &special); /// Try parsing an rgb color like "#F0A030". - bool try_parse_rgb(const wcstring &str); + bool try_parse_rgb(const wcstring &name); /// Try parsing an explicit color name like "magenta". bool try_parse_named(const wcstring &str); diff --git a/src/common.h b/src/common.h index fafe40456..f32e7e11a 100644 --- a/src/common.h +++ b/src/common.h @@ -748,7 +748,7 @@ void append_path_component(wcstring &path, const wcstring &component); wcstring format_string(const wchar_t *format, ...); wcstring vformat_string(const wchar_t *format, va_list va_orig); void append_format(wcstring &str, const wchar_t *format, ...); -void append_formatv(wcstring &str, const wchar_t *format, va_list ap); +void append_formatv(wcstring &target, const wchar_t *format, va_list va_orig); #ifdef HAVE_STD__MAKE_UNIQUE using std::make_unique; @@ -764,7 +764,7 @@ std::unique_ptr make_unique(Args &&... args) { /// character is detemrined by examining \c in. Returns 0 on error. /// /// \param in the position of the opening quote. -wchar_t *quote_end(const wchar_t *in); +wchar_t *quote_end(const wchar_t *pos); /// A call to this function will reset the error counter. Some functions print out non-critical /// error messages. These should check the error_count before, and skip printing the message if @@ -1031,7 +1031,7 @@ struct hash { #endif /// Get the absolute path to the fish executable itself -std::string get_executable_path(const char *fallback); +std::string get_executable_path(const char *argv0); /// A RAII wrapper for resources that don't recur, so we don't have to create a separate RAII /// wrapper for each function. Avoids needing to call "return cleanup()" or similar / everywhere. diff --git a/src/complete.cpp b/src/complete.cpp index 0d765e2f3..79ebaa723 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -354,7 +354,7 @@ class completer_t { void complete_cmd(const wcstring &str); /// Attempt to complete an abbreviation for the given string. - void complete_abbr(const wcstring &str); + void complete_abbr(const wcstring &cmd); void complete_from_args(const wcstring &str, const wcstring &args, const wcstring &desc, complete_flags_t flags); diff --git a/src/complete.h b/src/complete.h index 67fe20c84..32e63b813 100644 --- a/src/complete.h +++ b/src/complete.h @@ -196,8 +196,8 @@ void append_completion(std::vector *completions, wcstring comp, string_fuzzy_match_t match = string_fuzzy_match_t(fuzzy_match_exact)); /// Support for "wrap targets." A wrap target is a command that completes like another command. -bool complete_add_wrapper(const wcstring &command, const wcstring &wrap_target); -bool complete_remove_wrapper(const wcstring &command, const wcstring &wrap_target); +bool complete_add_wrapper(const wcstring &command, const wcstring &new_target); +bool complete_remove_wrapper(const wcstring &command, const wcstring &target_to_remove); /// Returns a list of wrap targets for a given command. wcstring_list_t complete_get_wrap_targets(const wcstring &command); diff --git a/src/env_universal_common.h b/src/env_universal_common.h index 3268b1c54..e023b8fba 100644 --- a/src/env_universal_common.h +++ b/src/env_universal_common.h @@ -62,7 +62,7 @@ class env_universal_t { void load_from_fd(int fd, callback_data_list_t &callbacks); void set_internal(const wcstring &key, const env_var_t &var); - bool remove_internal(const wcstring &name); + bool remove_internal(const wcstring &key); // Functions concerned with saving. bool open_and_acquire_lock(const std::string &path, int *out_fd); @@ -82,7 +82,7 @@ class env_universal_t { // vars_to_acquire. void acquire_variables(var_table_t &vars_to_acquire); - static bool populate_1_variable(const wchar_t *str, env_var_t::env_var_flags_t flags, + static bool populate_1_variable(const wchar_t *input, env_var_t::env_var_flags_t flags, var_table_t *vars, wcstring *storage); static void parse_message_2x_internal(const wcstring &msg, var_table_t *vars, @@ -106,7 +106,7 @@ class env_universal_t { void set(const wcstring &key, env_var_t var); // Removes a variable. Returns true if it was found, false if not. - bool remove(const wcstring &name); + bool remove(const wcstring &key); // Gets variable names. wcstring_list_t get_names(bool show_exported, bool show_unexported) const; diff --git a/src/exec.h b/src/exec.h index 12c5d9051..ce3faf2a7 100644 --- a/src/exec.h +++ b/src/exec.h @@ -24,8 +24,8 @@ bool exec_job(parser_t &parser, std::shared_ptr j); /// /// \return the status of the last job to exit, or -1 if en error was encountered. int exec_subshell(const wcstring &cmd, parser_t &parser, wcstring_list_t &outputs, - bool preserve_exit_status, bool is_subcmd = false); -int exec_subshell(const wcstring &cmd, parser_t &parser, bool preserve_exit_status, + bool apply_exit_status, bool is_subcmd = false); +int exec_subshell(const wcstring &cmd, parser_t &parser, bool apply_exit_status, bool is_subcmd = false); /// Loops over close until the syscall was run without being interrupted. diff --git a/src/expand.h b/src/expand.h index 9accf704b..294be885e 100644 --- a/src/expand.h +++ b/src/expand.h @@ -146,8 +146,8 @@ __warn_unused expand_result_t expand_string(wcstring input, std::vector &parser, parse_error_list_t *errors = NULL); /// Expand a command string like $HOME/bin/cmd into a command and list of arguments. diff --git a/src/function.h b/src/function.h index a5eaaac2d..b777f7539 100644 --- a/src/function.h +++ b/src/function.h @@ -61,13 +61,13 @@ void function_set_desc(const wcstring &name, const wcstring &desc, parser_t &par /// Returns true if the function with the name name exists. /// This may autoload. -int function_exists(const wcstring &name, parser_t &parser); +int function_exists(const wcstring &cmd, parser_t &parser); /// Attempts to load a function if not yet loaded. This is used by the completion machinery. -void function_load(const wcstring &name, parser_t &parser); +void function_load(const wcstring &cmd, parser_t &parser); /// Returns true if the function with the name name exists, without triggering autoload. -int function_exists_no_autoload(const wcstring &name); +int function_exists_no_autoload(const wcstring &cmd); /// Returns all function names. /// diff --git a/src/highlight.h b/src/highlight.h index ec35e1cfe..79cc2e846 100644 --- a/src/highlight.h +++ b/src/highlight.h @@ -126,7 +126,7 @@ enum { PATH_EXPAND_TILDE = 1 << 1 }; typedef unsigned int path_flags_t; -bool is_potential_path(const wcstring &const_path, const wcstring_list_t &directories, +bool is_potential_path(const wcstring &potential_path_fragment, const wcstring_list_t &directories, const environment_t &vars, path_flags_t flags); #endif diff --git a/src/history.cpp b/src/history.cpp index e3b7e61cb..a245fb948 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -153,7 +153,7 @@ class history_lru_cache_t : public lru_cache_t get_names(bool user = true) const; @@ -110,10 +110,10 @@ class input_mapping_set_t { /// \param sequence the sequence to bind /// \param command an input function that will be run whenever the key sequence occurs void add(wcstring sequence, const wchar_t *command, const wchar_t *mode = DEFAULT_BIND_MODE, - const wchar_t *new_mode = DEFAULT_BIND_MODE, bool user = true); + const wchar_t *sets_mode = DEFAULT_BIND_MODE, bool user = true); void add(wcstring sequence, const wchar_t *const *commands, size_t commands_len, - const wchar_t *mode = DEFAULT_BIND_MODE, const wchar_t *new_mode = DEFAULT_BIND_MODE, + const wchar_t *mode = DEFAULT_BIND_MODE, const wchar_t *sets_mode = DEFAULT_BIND_MODE, bool user = true); /// \return a snapshot of the list of input mappings. diff --git a/src/output.h b/src/output.h index dee1ad982..7ef8f760e 100644 --- a/src/output.h +++ b/src/output.h @@ -108,15 +108,15 @@ void writembs_check(outputter_t &outp, const char *mbs, const char *mbs_name, bo #define writembs(outp, mbs) writembs_check((outp), (mbs), #mbs, true, __FILE__, __LINE__) #define writembs_nofail(outp, mbs) writembs_check((outp), (mbs), #mbs, false, __FILE__, __LINE__) -rgb_color_t parse_color(const env_var_t &val, bool is_background); +rgb_color_t parse_color(const env_var_t &var, bool is_background); /// Sets what colors are supported. enum { color_support_term256 = 1 << 0, color_support_term24bit = 1 << 1 }; typedef unsigned int color_support_t; color_support_t output_get_color_support(); -void output_set_color_support(color_support_t support); +void output_set_color_support(color_support_t val); -rgb_color_t best_color(const std::vector &colors, color_support_t support); +rgb_color_t best_color(const std::vector &candidates, color_support_t support); unsigned char index_for_color(rgb_color_t c); diff --git a/src/pager.h b/src/pager.h index 42b47a735..943f2ff47 100644 --- a/src/pager.h +++ b/src/pager.h @@ -131,7 +131,7 @@ class pager_t { bool completion_info_passes_filter(const comp_t &info) const; - void completion_print(size_t cols, const size_t *width_per_column, size_t row_start, + void completion_print(size_t cols, const size_t *width_by_column, size_t row_start, size_t row_stop, const wcstring &prefix, const comp_info_list_t &lst, page_rendering_t *rendering) const; line_t completion_print_item(const wcstring &prefix, const comp_t *c, size_t row, size_t column, @@ -143,7 +143,7 @@ class pager_t { editable_line_t search_field_line; // Sets the set of completions. - void set_completions(const completion_list_t &comp); + void set_completions(const completion_list_t &raw_completions); // Sets the prefix. void set_prefix(const wcstring &pref); diff --git a/src/parse_execution.h b/src/parse_execution.h index c5abcab85..ff0c751d5 100644 --- a/src/parse_execution.h +++ b/src/parse_execution.h @@ -57,7 +57,7 @@ class parse_execution_context_t { // Report an error. Always returns true. parse_execution_result_t report_error(const parse_node_t &node, const wchar_t *fmt, ...) const; - parse_execution_result_t report_errors(const parse_error_list_t &errors) const; + parse_execution_result_t report_errors(const parse_error_list_t &error_list) const; // Wildcard error helper. parse_execution_result_t report_unmatched_wildcard_error( @@ -113,7 +113,7 @@ class parse_execution_context_t { parse_execution_result_t run_if_statement(tnode_t statement, const block_t *associated_block); parse_execution_result_t run_switch_statement(tnode_t statement); - parse_execution_result_t run_while_statement(tnode_t statement, + parse_execution_result_t run_while_statement(tnode_t header, tnode_t contents, const block_t *associated_block); parse_execution_result_t run_function_statement(tnode_t header, @@ -131,7 +131,7 @@ class parse_execution_context_t { io_chain_t *out_chain); parse_execution_result_t run_1_job(tnode_t job, const block_t *associated_block); - parse_execution_result_t run_job_conjunction(tnode_t job_conj, + parse_execution_result_t run_job_conjunction(tnode_t job_expr, const block_t *associated_block); template parse_execution_result_t run_job_list(tnode_t job_list_node, @@ -141,7 +141,7 @@ class parse_execution_context_t { // Returns the line number of the node. Not const since it touches cached_lineno_offset. int line_offset_of_node(tnode_t node); - int line_offset_of_character_at_offset(size_t char_idx); + int line_offset_of_character_at_offset(size_t offset); public: parse_execution_context_t(parsed_source_ref_t pstree, parser_t *p, diff --git a/src/parse_tree.cpp b/src/parse_tree.cpp index 56c38b707..7898b7f5b 100644 --- a/src/parse_tree.cpp +++ b/src/parse_tree.cpp @@ -385,9 +385,9 @@ class parse_ll_t { bool top_node_handle_terminal_types(const parse_token_t &token); void parse_error_unexpected_token(const wchar_t *expected, parse_token_t token); - void parse_error(parse_token_t token, parse_error_code_t code, const wchar_t *format, ...); + void parse_error(parse_token_t token, parse_error_code_t code, const wchar_t *fmt, ...); void parse_error_at_location(size_t source_start, size_t source_length, size_t error_location, - parse_error_code_t code, const wchar_t *format, ...); + parse_error_code_t code, const wchar_t *fmt, ...); void parse_error_failed_production(struct parse_stack_element_t &elem, parse_token_t token); void parse_error_unbalancing_token(parse_token_t token); diff --git a/src/parse_tree.h b/src/parse_tree.h index 208f9ad11..54b173266 100644 --- a/src/parse_tree.h +++ b/src/parse_tree.h @@ -66,7 +66,7 @@ enum { }; typedef unsigned int parse_tree_flags_t; -wcstring parse_dump_tree(const parse_node_tree_t &tree, const wcstring &src); +wcstring parse_dump_tree(const parse_node_tree_t &nodes, const wcstring &src); const wchar_t *token_type_description(parse_token_type_t type); const wchar_t *keyword_description(parse_keyword_t type); @@ -200,7 +200,7 @@ class parse_node_tree_t : public std::vector { // Utilities /// Given a node, return all of its comment nodes. - std::vector> comment_nodes_for_node(const parse_node_t &node) const; + std::vector> comment_nodes_for_node(const parse_node_t &parent) const; private: template @@ -209,7 +209,7 @@ class parse_node_tree_t : public std::vector { /// the next element of the given type in that list, and the tail (by reference). Returns NULL /// if we've exhausted the list. const parse_node_t *next_node_in_node_list(const parse_node_t &node_list, - parse_token_type_t item_type, + parse_token_type_t entry_type, const parse_node_t **list_tail) const; }; diff --git a/src/parse_util.h b/src/parse_util.h index 7eca9a88f..49458eed0 100644 --- a/src/parse_util.h +++ b/src/parse_util.h @@ -84,7 +84,7 @@ void parse_util_token_extent(const wchar_t *buff, size_t cursor_pos, const wchar const wchar_t **prev_end); /// Get the linenumber at the specified character offset. -int parse_util_lineno(const wchar_t *str, size_t len); +int parse_util_lineno(const wchar_t *str, size_t offset); /// Calculate the line number of the specified cursor position. int parse_util_get_line_from_offset(const wcstring &str, size_t pos); @@ -97,7 +97,7 @@ size_t parse_util_get_offset(const wcstring &str, int line, long line_offset); /// Return the given string, unescaping wildcard characters but not performing any other character /// transformation. -wcstring parse_util_unescape_wildcards(const wcstring &in); +wcstring parse_util_unescape_wildcards(const wcstring &str); /// Checks if the specified string is a help option. bool parse_util_argument_is_help(const wchar_t *s); diff --git a/src/parser.h b/src/parser.h index 61189957a..d14805776 100644 --- a/src/parser.h +++ b/src/parser.h @@ -229,7 +229,7 @@ class parser_t : public std::enable_shared_from_this { wcstring user_presentable_path(const wcstring &path) const; /// Helper for stack_trace(). - void stack_trace_internal(size_t block_idx, wcstring *out) const; + void stack_trace_internal(size_t block_idx, wcstring *buff) const; /// Create a parser. parser_t(); @@ -318,7 +318,7 @@ class parser_t : public std::enable_shared_from_this { block_t *push_block(block_t &&b); /// Remove the outermost block, asserting it's the given one. - void pop_block(const block_t *b); + void pop_block(const block_t *expected); /// Return a description of the given blocktype. const wchar_t *get_block_desc(int block) const; diff --git a/src/path.h b/src/path.h index 4b5cb98ff..1bf64cb4b 100644 --- a/src/path.h +++ b/src/path.h @@ -44,7 +44,7 @@ void path_emit_config_directory_errors(env_stack_t &vars); /// Returns: /// false if the command can not be found else true. The result /// should be freed with free(). -bool path_get_path(const wcstring &cmd, wcstring *output_or_NULL, const environment_t &vars); +bool path_get_path(const wcstring &cmd, wcstring *out_path, const environment_t &vars); /// Return all the paths that match the given command. wcstring_list_t path_get_paths(const wcstring &cmd, const environment_t &vars); diff --git a/src/proc.h b/src/proc.h index ad498b9f1..16dabfbad 100644 --- a/src/proc.h +++ b/src/proc.h @@ -261,7 +261,7 @@ typedef std::vector process_list_t; typedef int job_id_t; job_id_t acquire_job_id(void); -void release_job_id(job_id_t jobid); +void release_job_id(job_id_t jid); /// A struct represeting a job. A job is basically a pipeline of one or more processes and a couple /// of flags. @@ -488,7 +488,7 @@ class parser_t; bool job_reap(parser_t &parser, bool interactive); /// Mark a process as failed to execute (and therefore completed). -void job_mark_process_as_failed(const std::shared_ptr &job, const process_t *p); +void job_mark_process_as_failed(const std::shared_ptr &job, const process_t *failed_proc); /// Use the procfs filesystem to look up how many jiffies of cpu time was used by this process. This /// function is only available on systems with the procfs file entry 'stat', i.e. Linux. diff --git a/src/reader.h b/src/reader.h index a6b4ca3ef..11f1646bf 100644 --- a/src/reader.h +++ b/src/reader.h @@ -184,7 +184,7 @@ void reader_set_allow_autosuggesting(bool flag); void reader_set_expand_abbreviations(bool flag); /// Sets whether the reader should exit on ^C. -void reader_set_exit_on_interrupt(bool flag); +void reader_set_exit_on_interrupt(bool i); void reader_set_silent_status(bool f); diff --git a/src/tnode.h b/src/tnode.h index b13958b2f..5221bef94 100644 --- a/src/tnode.h +++ b/src/tnode.h @@ -236,7 +236,7 @@ parse_statement_decoration_t get_decoration(tnode_t st enum parse_bool_statement_type_t bool_statement_type(tnode_t stmt); enum parse_bool_statement_type_t bool_statement_type( - tnode_t stmt); + tnode_t cont); /// Given a redirection node, get the parsed redirection and target of the redirection (file path, /// or fd). diff --git a/src/tokenizer.h b/src/tokenizer.h index 4d918d791..fada16eec 100644 --- a/src/tokenizer.h +++ b/src/tokenizer.h @@ -131,7 +131,7 @@ class tokenizer_t { /// \param flags Flags to the tokenizer. Setting TOK_ACCEPT_UNFINISHED will cause the tokenizer /// to accept incomplete tokens, such as a subshell without a closing parenthesis, as a valid /// token. Setting TOK_SHOW_COMMENTS will return comments as tokens - tokenizer_t(const wchar_t *b, tok_flags_t flags); + tokenizer_t(const wchar_t *start, tok_flags_t flags); /// Returns the next token, or none() if we are at the end. maybe_t next(); @@ -212,7 +212,7 @@ class move_word_state_machine_t { move_word_style_t style; public: - explicit move_word_state_machine_t(move_word_style_t st); + explicit move_word_state_machine_t(move_word_style_t syl); bool consume_char(wchar_t c); void reset(); }; diff --git a/src/utf8.cpp b/src/utf8.cpp index 7bd9351ae..030f94f7c 100644 --- a/src/utf8.cpp +++ b/src/utf8.cpp @@ -38,7 +38,7 @@ typedef wchar_t utf8_wchar_t; typedef std::basic_string utf8_wstring_t; -static size_t utf8_to_wchar_internal(const char *in, size_t insize, utf8_wstring_t *result, +static size_t utf8_to_wchar_internal(const char *in, size_t insize, utf8_wstring_t *out_string, int flags); static size_t wchar_to_utf8_internal(const utf8_wchar_t *in, size_t insize, char *out, size_t outsize, int flags); diff --git a/src/utf8.h b/src/utf8.h index 49d2b62b8..cfd2a1b2d 100644 --- a/src/utf8.h +++ b/src/utf8.h @@ -27,7 +27,7 @@ /// Convert a string between UTF8 and UCS-2/4 (depending on size of wchar_t). Returns true if /// successful, storing the result of the conversion in *result*. -bool wchar_to_utf8_string(const std::wstring &input, std::string *result); +bool wchar_to_utf8_string(const std::wstring &str, std::string *result); /// Convert a string between UTF8 and UCS-2/4 (depending on size of wchar_t). Returns nonzero if /// successful, storing the result of the conversion in *out*. diff --git a/src/wutil.h b/src/wutil.h index e31d90d30..ca261f63a 100644 --- a/src/wutil.h +++ b/src/wutil.h @@ -56,10 +56,10 @@ int wstat(const wcstring &file_name, struct stat *buf); int lwstat(const wcstring &file_name, struct stat *buf); /// Wide character version of access(). -int waccess(const wcstring &pathname, int mode); +int waccess(const wcstring &file_name, int mode); /// Wide character version of unlink(). -int wunlink(const wcstring &pathname); +int wunlink(const wcstring &file_name); /// Wide character version of perror(). void wperror(const wchar_t *s); @@ -113,10 +113,10 @@ std::wstring wbasename(const std::wstring &path); const wcstring &wgettext(const wchar_t *in); /// Wide character version of mkdir. -int wmkdir(const wcstring &dir, int mode); +int wmkdir(const wcstring &name, int mode); /// Wide character version of rename. -int wrename(const wcstring &oldName, const wcstring &newName); +int wrename(const wcstring &oldName, const wcstring &newv); #define PUA1_START 0xE000 #define PUA1_END 0xF900