From ddcd2b0810087394d17bd80c46d74cca0acd8924 Mon Sep 17 00:00:00 2001 From: Geoff Nixon Date: Thu, 27 Feb 2014 03:15:00 -0800 Subject: [PATCH 1/2] Dead stores --- builtin_test.cpp | 2 -- common.cpp | 6 +----- fish.cpp | 2 -- history.cpp | 7 +------ pager.cpp | 4 +--- parse_execution.cpp | 1 - parse_tree.cpp | 1 - parser.cpp | 4 ---- proc.cpp | 1 - 9 files changed, 3 insertions(+), 25 deletions(-) diff --git a/builtin_test.cpp b/builtin_test.cpp index 0d16823af..a2045cc4b 100644 --- a/builtin_test.cpp +++ b/builtin_test.cpp @@ -652,7 +652,6 @@ expression *test_parser::parse_args(const wcstring_list_t &args, wcstring &err) err.append(L"test: "); err.append(parser.errors.at(i)); err.push_back(L'\n'); - errored = true; // For now we only show the first error break; } @@ -667,7 +666,6 @@ expression *test_parser::parse_args(const wcstring_list_t &args, wcstring &err) { append_format(err, L"test: unexpected argument at index %lu: '%ls'\n", (unsigned long)result->range.end, args.at(result->range.end).c_str()); } - errored = true; delete result; result = NULL; diff --git a/common.cpp b/common.cpp index 08e8d7a1f..7434c31d9 100644 --- a/common.cpp +++ b/common.cpp @@ -866,11 +866,7 @@ void write_screen(const wcstring &msg, wcstring &buff) /* If token is zero character long, we don't do anything */ - if (pos == start) - { - start = pos = pos+1; - } - else if (overflow) + if (overflow) { /* In case of overflow, we print a newline, except if we already are at position 0 diff --git a/fish.cpp b/fish.cpp index 35b641ee0..53262929b 100644 --- a/fish.cpp +++ b/fish.cpp @@ -213,8 +213,6 @@ static struct config_paths_t determine_config_directory_paths(const char *argv0) paths.sysconf = L"" SYSCONFDIR "/fish"; paths.doc = L"" DOCDIR; paths.bin = L"" BINDIR; - - done = true; } return paths; diff --git a/history.cpp b/history.cpp index f8183f5d8..0c7bc6184 100644 --- a/history.cpp +++ b/history.cpp @@ -1338,7 +1338,7 @@ bool history_t::save_internal_via_rewrite() for (size_t attempt = 0; attempt < 10 && out_fd == -1; attempt++) { char *narrow_str = wcs2str(tmp_name_template.c_str()); - if (narrow_str && mktemp(narrow_str)) + if (narrow_str && mkstemp(narrow_str)) { /* It was successfully templated; try opening it atomically */ tmp_name = str2wcstring(narrow_str); @@ -1507,11 +1507,6 @@ void history_t::save_internal(bool vacuum) /* Try doing a fast append */ ok = save_internal_via_appending(); } - if (! ok) - { - /* We did not or could not append; rewrite the file ("vacuum" it) */ - ok = this->save_internal_via_rewrite(); - } } void history_t::save(void) diff --git a/pager.cpp b/pager.cpp index b137bca2f..0fa7eb4c7 100644 --- a/pager.cpp +++ b/pager.cpp @@ -147,7 +147,6 @@ line_t pager_t::completion_print_item(const wcstring &prefix, const comp_t *c, s } written += print_max(L"(", packed_color, 1, false, &line_data); written += print_max(c->desc, packed_color, desc_width, false, &line_data); - written += print_max(L")", packed_color, 1, false, &line_data); } else { @@ -635,7 +634,6 @@ bool pager_t::completion_try_print(size_t cols, const wcstring &prefix, const co /* We limit the width to term_width - 1 */ int search_field_written = print_max(SEARCH_FIELD_PROMPT, highlight_spec_normal, term_width - 1, false, search_field); - search_field_written += print_max(search_field_text, highlight_modifier_force_underline, term_width - search_field_written - 1, false, search_field); } } @@ -747,7 +745,7 @@ bool pager_t::select_next_completion_in_direction(selection_direction_t directio } /* Ok, we had something selected already. Select something different. */ - size_t new_selected_completion_idx = selected_completion_idx; + size_t new_selected_completion_idx; if (! selection_direction_is_cardinal(direction)) { /* Next, previous, or deselect, all easy */ diff --git a/parse_execution.cpp b/parse_execution.cpp index 726f29207..d57b8e7ec 100644 --- a/parse_execution.cpp +++ b/parse_execution.cpp @@ -532,7 +532,6 @@ parse_execution_result_t parse_execution_context_t::run_switch_statement(const p { /* Store the node that failed to expand */ report_error(switch_value_node, WILDCARD_ERR_MSG, switch_value.c_str()); - ret = parse_execution_errored; break; } diff --git a/parse_tree.cpp b/parse_tree.cpp index 484b79687..eb139e633 100644 --- a/parse_tree.cpp +++ b/parse_tree.cpp @@ -987,7 +987,6 @@ void parse_ll_t::accept_tokens(parse_token_t token1, parse_token_t token2) { fprintf(stderr, "Consumed token %ls\n", token1.describe().c_str()); } - consumed = true; break; } diff --git a/parser.cpp b/parser.cpp index 0a4f004ae..9435d3d12 100644 --- a/parser.cpp +++ b/parser.cpp @@ -2592,10 +2592,6 @@ int parser_t::eval_new_parser(const wcstring &cmd, const io_chain_t &io, enum bl /* Execute the first node */ int result = 1; - if (! tree.empty()) - { - result = this->eval_block_node(0, io, block_type); - } /* Clean up the execution context stack */ assert(! execution_contexts.empty() && execution_contexts.back() == ctx); diff --git a/proc.cpp b/proc.cpp index 2ea0d1bd4..9c66292dc 100644 --- a/proc.cpp +++ b/proc.cpp @@ -398,7 +398,6 @@ static void mark_process_status(const job_t *j, process_t *p, int status) handler. If things aren't working properly, it's safer to give up. */ - ignore = write(2, mess, strlen(mess)); } } From 18dd6f58e3b9bc44d9850947bdb3f17c2f05f2cf Mon Sep 17 00:00:00 2001 From: Geoff Nixon Date: Thu, 27 Feb 2014 02:55:04 -0800 Subject: [PATCH 2/2] Fixes .c -> .cpp in comments. For doxygen. --- Doxyfile | 2 +- builtin.cpp | 2 +- builtin_commandline.cpp | 2 +- builtin_complete.cpp | 6 +++--- builtin_jobs.cpp | 2 +- builtin_printf.cpp | 3 +++ builtin_set.cpp | 2 +- builtin_test.cpp | 1 - builtin_ulimit.cpp | 2 +- common.cpp | 2 +- complete.cpp | 2 +- env.cpp | 2 +- env_universal.cpp | 6 ++++++ env_universal_common.cpp | 3 +-- event.cpp | 2 +- exec.cpp | 2 +- expand.cpp | 2 +- fallback.cpp | 3 ++- fish.cpp | 8 +++----- fish_indent.cpp | 8 +++----- fish_pager.cpp | 7 ++++--- fish_tests.cpp | 2 +- fishd.cpp | 2 +- function.cpp | 2 +- highlight.cpp | 2 +- history.cpp | 7 ++++++- input.cpp | 2 +- input_common.cpp | 2 +- intern.cpp | 2 +- io.cpp | 2 +- iothread.cpp | 3 +++ key_reader.cpp | 3 ++- kill.cpp | 2 +- mimedb.cpp | 2 +- output.cpp | 2 +- pager.cpp | 10 ++++------ parse_execution.cpp | 1 - parse_productions.cpp | 4 ++++ parse_tree.cpp | 3 +++ parse_util.cpp | 2 +- parser.cpp | 5 +---- parser_keywords.cpp | 2 +- path.cpp | 4 ++++ print_help.cpp | 3 +-- proc.cpp | 4 +--- reader.cpp | 2 +- sanity.cpp | 2 +- screen.cpp | 3 +-- share/doxygen_sqlite3.db | Bin 0 -> 13312 bytes signal.cpp | 4 ++-- tokenizer.cpp | 2 +- util.cpp | 2 +- wgetopt.cpp | 2 +- wildcard.cpp | 2 +- wutil.cpp | 2 +- xdgmime.cpp | 3 +++ xdgmimealias.cpp | 4 +++- xdgmimeglob.cpp | 4 +++- xdgmimeint.cpp | 5 ++++- xdgmimemagic.cpp | 3 +++ xdgmimeparent.cpp | 2 ++ 61 files changed, 107 insertions(+), 77 deletions(-) create mode 100644 share/doxygen_sqlite3.db diff --git a/Doxyfile b/Doxyfile index d25badb90..57bd35efb 100644 --- a/Doxyfile +++ b/Doxyfile @@ -422,7 +422,7 @@ INPUT = # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp # *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm -FILE_PATTERNS = *.h *.c +FILE_PATTERNS = *.h *.cpp # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. diff --git a/builtin.cpp b/builtin.cpp index 8b8b8d5c2..947276e24 100644 --- a/builtin.cpp +++ b/builtin.cpp @@ -1,4 +1,4 @@ -/** \file builtin.c +/** \file builtin.cpp Functions for executing builtin functions. How to add a new builtin function: diff --git a/builtin_commandline.cpp b/builtin_commandline.cpp index 564eee7bc..1dac978d7 100644 --- a/builtin_commandline.cpp +++ b/builtin_commandline.cpp @@ -1,4 +1,4 @@ -/** \file builtin_commandline.c Functions defining the commandline builtin +/** \file builtin_commandline.cpp Functions defining the commandline builtin Functions used for implementing the commandline builtin. diff --git a/builtin_complete.cpp b/builtin_complete.cpp index 6e395f946..ea69fa305 100644 --- a/builtin_complete.cpp +++ b/builtin_complete.cpp @@ -1,4 +1,4 @@ -/** \file builtin_complete.c Functions defining the complete builtin +/** \file builtin_complete.cpp Functions defining the complete builtin Functions used for implementing the complete builtin. @@ -279,8 +279,8 @@ const wchar_t *builtin_complete_get_temporary_buffer() /** The complete builtin. Used for specifying programmable - tab-completions. Calls the functions in complete.c for any heavy - lifting. Defined in builtin_complete.c + tab-completions. Calls the functions in complete.cpp for any heavy + lifting. Defined in builtin_complete.cpp */ static int builtin_complete(parser_t &parser, wchar_t **argv) { diff --git a/builtin_jobs.cpp b/builtin_jobs.cpp index c6ca77132..a21aeafc8 100644 --- a/builtin_jobs.cpp +++ b/builtin_jobs.cpp @@ -1,4 +1,4 @@ -/** \file builtin_jobs.c +/** \file builtin_jobs.cpp Functions for executing the jobs builtin. */ #include "config.h" diff --git a/builtin_printf.cpp b/builtin_printf.cpp index 1a1ab3350..92be1a961 100644 --- a/builtin_printf.cpp +++ b/builtin_printf.cpp @@ -1,3 +1,6 @@ +/** \file builtin_printf.cpp +*/ + /* printf - format and print data Copyright (C) 1990-2007 Free Software Foundation, Inc. diff --git a/builtin_set.cpp b/builtin_set.cpp index 633416497..399b7e827 100644 --- a/builtin_set.cpp +++ b/builtin_set.cpp @@ -1,4 +1,4 @@ -/** \file builtin_set.c Functions defining the set builtin +/** \file builtin_set.cpp Functions defining the set builtin Functions used for implementing the set builtin. diff --git a/builtin_test.cpp b/builtin_test.cpp index a2045cc4b..6a353029f 100644 --- a/builtin_test.cpp +++ b/builtin_test.cpp @@ -646,7 +646,6 @@ expression *test_parser::parse_args(const wcstring_list_t &args, wcstring &err) expression *result = parser.parse_expression(0, (unsigned int)args.size()); /* Handle errors */ - bool errored = false; for (size_t i = 0; i < parser.errors.size(); i++) { err.append(L"test: "); diff --git a/builtin_ulimit.cpp b/builtin_ulimit.cpp index 37bebd61f..7a0731f18 100644 --- a/builtin_ulimit.cpp +++ b/builtin_ulimit.cpp @@ -1,4 +1,4 @@ -/** \file builtin_ulimit.c Functions defining the ulimit builtin +/** \file builtin_ulimit.cpp Functions defining the ulimit builtin Functions used for implementing the ulimit builtin. diff --git a/common.cpp b/common.cpp index 7434c31d9..6e2160097 100644 --- a/common.cpp +++ b/common.cpp @@ -1,4 +1,4 @@ -/** \file common.c +/** \file common.cpp Various functions, mostly string utilities, that are used by most parts of fish. diff --git a/complete.cpp b/complete.cpp index 9b8d5c0b1..aee35bbda 100644 --- a/complete.cpp +++ b/complete.cpp @@ -1,4 +1,4 @@ -/** \file complete.c Functions related to tab-completion. +/** \file complete.cpp Functions related to tab-completion. These functions are used for storing and retrieving tab-completion data, as well as for performing tab-completion. */ diff --git a/env.cpp b/env.cpp index ab7f63e5d..074e3d1a0 100644 --- a/env.cpp +++ b/env.cpp @@ -1,4 +1,4 @@ -/** \file env.c +/** \file env.cpp Functions for setting and getting environment variables. */ #include "config.h" diff --git a/env_universal.cpp b/env_universal.cpp index 72e9cc0e6..7e2a0970b 100644 --- a/env_universal.cpp +++ b/env_universal.cpp @@ -1,3 +1,9 @@ +/** \file env_universal.cpp + +Various functions, mostly string utilities, that are used by most +parts of fish. +*/ + #include "config.h" diff --git a/env_universal_common.cpp b/env_universal_common.cpp index dbf79c1a6..2b54a3bc3 100644 --- a/env_universal_common.cpp +++ b/env_universal_common.cpp @@ -1,5 +1,4 @@ -/** - \file env_universal_common.c +/** \file env_universal_common.cpp The utility library for universal variables. Used both by the client library and by the daemon. diff --git a/event.cpp b/event.cpp index 65d337f02..85cd5f978 100644 --- a/event.cpp +++ b/event.cpp @@ -1,4 +1,4 @@ -/** \file event.c +/** \file event.cpp Functions for handling event triggers diff --git a/exec.cpp b/exec.cpp index 832c88847..12458a51f 100644 --- a/exec.cpp +++ b/exec.cpp @@ -1,4 +1,4 @@ -/** \file exec.c +/** \file exec.cpp Functions for executing a program. Some of the code in this file is based on code from the Glibc diff --git a/expand.cpp b/expand.cpp index cd7194a3b..d087559da 100644 --- a/expand.cpp +++ b/expand.cpp @@ -1,4 +1,4 @@ -/**\file expand.c +/**\file expand.cpp String expansion functions. These functions perform several kinds of parameter expansion. diff --git a/fallback.cpp b/fallback.cpp index d26907e2b..48a6a220b 100644 --- a/fallback.cpp +++ b/fallback.cpp @@ -1,4 +1,5 @@ -/** +/** \file fallback.cpp + This file only contains fallback implementations of functions which have been found to be missing or broken by the configuration scripts. diff --git a/fish.cpp b/fish.cpp index 53262929b..21c9cb3f7 100644 --- a/fish.cpp +++ b/fish.cpp @@ -1,3 +1,6 @@ +/** \file fish.cpp + The main loop of fish. +*/ /* Copyright (C) 2005-2008 Axel Liljencrantz @@ -15,11 +18,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - -/** \file fish.c - The main loop of fish. -*/ - #include "config.h" diff --git a/fish_indent.cpp b/fish_indent.cpp index 4560bb961..ec668a839 100644 --- a/fish_indent.cpp +++ b/fish_indent.cpp @@ -1,3 +1,6 @@ +/** \file fish_indent.cpp + The fish_indent proegram. +*/ /* Copyright (C) 2005-2008 Axel Liljencrantz @@ -15,11 +18,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - -/** \file fish_indent.cpp - The fish_indent proegram. -*/ - #include "config.h" #include diff --git a/fish_pager.cpp b/fish_pager.cpp index f640e9959..f0103be3e 100644 --- a/fish_pager.cpp +++ b/fish_pager.cpp @@ -1,3 +1,7 @@ +/** \file fish_pager.cpp +*/ + + #include "config.h" #include @@ -439,9 +443,6 @@ static void completion_print_item(const wchar_t *prefix, comp_t *c, int width, b writech(L' '); } set_color(get_color(HIGHLIGHT_PAGER_DESCRIPTION), bg); - written += print_max(L"(", 1, 0); - written += print_max(c->desc.c_str(), desc_width, 0); - written += print_max(L")", 1, 0); } else { diff --git a/fish_tests.cpp b/fish_tests.cpp index 7e82193cf..6494c6d36 100644 --- a/fish_tests.cpp +++ b/fish_tests.cpp @@ -1,4 +1,4 @@ -/** \file fish_tests.c +/** \file fish_tests.cpp Various bug and feature tests. Compiled and run by make test. */ diff --git a/fishd.cpp b/fishd.cpp index 30ded3cdd..57f04a0fb 100644 --- a/fishd.cpp +++ b/fishd.cpp @@ -1,4 +1,4 @@ -/** \file fishd.c +/** \file fishd.cpp The universal variable server. fishd is automatically started by fish if a fishd server isn't already running. fishd reads any saved diff --git a/function.cpp b/function.cpp index 8421a4daa..e58652c1e 100644 --- a/function.cpp +++ b/function.cpp @@ -1,4 +1,4 @@ -/** \file function.c +/** \file function.cpp Prototypes for functions for storing and retrieving function information. These functions also take care of autoloading diff --git a/highlight.cpp b/highlight.cpp index eaaec750a..216948845 100644 --- a/highlight.cpp +++ b/highlight.cpp @@ -1,4 +1,4 @@ -/** \file highlight.c +/** \file highlight.cpp Functions for syntax highlighting */ #include "config.h" diff --git a/history.cpp b/history.cpp index 0c7bc6184..f8183f5d8 100644 --- a/history.cpp +++ b/history.cpp @@ -1338,7 +1338,7 @@ bool history_t::save_internal_via_rewrite() for (size_t attempt = 0; attempt < 10 && out_fd == -1; attempt++) { char *narrow_str = wcs2str(tmp_name_template.c_str()); - if (narrow_str && mkstemp(narrow_str)) + if (narrow_str && mktemp(narrow_str)) { /* It was successfully templated; try opening it atomically */ tmp_name = str2wcstring(narrow_str); @@ -1507,6 +1507,11 @@ void history_t::save_internal(bool vacuum) /* Try doing a fast append */ ok = save_internal_via_appending(); } + if (! ok) + { + /* We did not or could not append; rewrite the file ("vacuum" it) */ + ok = this->save_internal_via_rewrite(); + } } void history_t::save(void) diff --git a/input.cpp b/input.cpp index 93c73d466..f08a18bbd 100644 --- a/input.cpp +++ b/input.cpp @@ -1,4 +1,4 @@ -/** \file input.c +/** \file input.cpp Functions for reading a character of input from stdin. diff --git a/input_common.cpp b/input_common.cpp index d26f30b97..c9a2afbf1 100644 --- a/input_common.cpp +++ b/input_common.cpp @@ -1,4 +1,4 @@ -/** \file input_common.c +/** \file input_common.cpp Implementation file for the low level input library diff --git a/intern.cpp b/intern.cpp index 56dec21a8..4cb2994fd 100644 --- a/intern.cpp +++ b/intern.cpp @@ -1,4 +1,4 @@ -/** \file intern.c +/** \file intern.cpp Library for pooling common strings diff --git a/io.cpp b/io.cpp index 3395942c2..11b5cd684 100644 --- a/io.cpp +++ b/io.cpp @@ -1,4 +1,4 @@ -/** \file io.c +/** \file io.cpp Utilities for io redirection. diff --git a/iothread.cpp b/iothread.cpp index 736467925..dbdff7ddc 100644 --- a/iothread.cpp +++ b/iothread.cpp @@ -1,3 +1,6 @@ +/** \file iothread.cpp +*/ + #include "config.h" #include "iothread.h" #include "common.h" diff --git a/key_reader.cpp b/key_reader.cpp index fae6f33fa..74347ba8c 100644 --- a/key_reader.cpp +++ b/key_reader.cpp @@ -1,4 +1,5 @@ -/* +/** \file key_reader.cpp + A small utility to print the resulting key codes from pressing a key. Servers the same function as hitting ^V in bash, but I prefer the way key_reader works. diff --git a/kill.cpp b/kill.cpp index 6ae27c519..e7bf7ea49 100644 --- a/kill.cpp +++ b/kill.cpp @@ -1,4 +1,4 @@ -/** \file kill.c +/** \file kill.cpp The killring. Works like the killring in emacs and readline. The killring is cut diff --git a/mimedb.cpp b/mimedb.cpp index fdf5da12d..fa1ab4002 100644 --- a/mimedb.cpp +++ b/mimedb.cpp @@ -1,4 +1,4 @@ -/** \file mimedb.c +/** \file mimedb.cpp mimedb is a program for checking the mimetype, description and default action associated with a file or mimetype. It uses the diff --git a/output.cpp b/output.cpp index 1f92c32ef..df508a448 100644 --- a/output.cpp +++ b/output.cpp @@ -1,4 +1,4 @@ -/** \file output.c +/** \file output.cpp Generic output functions */ diff --git a/pager.cpp b/pager.cpp index 0fa7eb4c7..4fbed6387 100644 --- a/pager.cpp +++ b/pager.cpp @@ -1,3 +1,7 @@ +/** \file pager.cpp +*/ + + #include "config.h" #include "pager.h" @@ -145,8 +149,6 @@ line_t pager_t::completion_print_item(const wcstring &prefix, const comp_t *c, s { written += print_max(L" ", packed_color, 1, false, &line_data); } - written += print_max(L"(", packed_color, 1, false, &line_data); - written += print_max(c->desc, packed_color, desc_width, false, &line_data); } else { @@ -630,10 +632,6 @@ bool pager_t::completion_try_print(size_t cols, const wcstring &prefix, const co { search_field_text.append(PAGER_SEARCH_FIELD_WIDTH - search_field_text.size(), L' '); } - line_t *search_field = &rendering->screen_data.insert_line_at_index(0); - - /* We limit the width to term_width - 1 */ - int search_field_written = print_max(SEARCH_FIELD_PROMPT, highlight_spec_normal, term_width - 1, false, search_field); } } diff --git a/parse_execution.cpp b/parse_execution.cpp index d57b8e7ec..13fbf0bb2 100644 --- a/parse_execution.cpp +++ b/parse_execution.cpp @@ -506,7 +506,6 @@ parse_execution_result_t parse_execution_context_t::run_for_statement(const pars parse_execution_result_t parse_execution_context_t::run_switch_statement(const parse_node_t &statement) { assert(statement.type == symbol_switch_statement); - parse_execution_result_t ret = parse_execution_success; const parse_node_t *matching_case_item = NULL; parse_execution_result_t result = parse_execution_success; diff --git a/parse_productions.cpp b/parse_productions.cpp index d559a0d93..d071be09c 100644 --- a/parse_productions.cpp +++ b/parse_productions.cpp @@ -1,3 +1,7 @@ +/** \file parse_productions.cpp +*/ + + #include "parse_productions.h" using namespace parse_productions; diff --git a/parse_tree.cpp b/parse_tree.cpp index eb139e633..9a174c732 100644 --- a/parse_tree.cpp +++ b/parse_tree.cpp @@ -1,3 +1,6 @@ +/** \file parse_tree.cpp +*/ + #include "parse_productions.h" #include "tokenizer.h" #include "fallback.h" diff --git a/parse_util.cpp b/parse_util.cpp index 230a328c9..4802d7cca 100644 --- a/parse_util.cpp +++ b/parse_util.cpp @@ -1,4 +1,4 @@ -/** \file parse_util.c +/** \file parse_util.cpp Various mostly unrelated utility functions related to parsing, loading and evaluating fish code. diff --git a/parser.cpp b/parser.cpp index 9435d3d12..69ff02368 100644 --- a/parser.cpp +++ b/parser.cpp @@ -1,4 +1,4 @@ -/** \file parser.c +/** \file parser.cpp The fish parser. Contains functions for parsing and evaluating code. @@ -2590,9 +2590,6 @@ int parser_t::eval_new_parser(const wcstring &cmd, const io_chain_t &io, enum bl parse_execution_context_t *ctx = new parse_execution_context_t(tree, cmd, this, exec_eval_level); execution_contexts.push_back(ctx); - /* Execute the first node */ - int result = 1; - /* Clean up the execution context stack */ assert(! execution_contexts.empty() && execution_contexts.back() == ctx); execution_contexts.pop_back(); diff --git a/parser_keywords.cpp b/parser_keywords.cpp index 8aacd8061..801cc3c89 100644 --- a/parser_keywords.cpp +++ b/parser_keywords.cpp @@ -1,4 +1,4 @@ -/** \file parser_keywords.c +/** \file parser_keywords.cpp Functions having to do with parser keywords, like testing if a function is a block command. */ diff --git a/path.cpp b/path.cpp index a2912f7b5..da550c7b5 100644 --- a/path.cpp +++ b/path.cpp @@ -1,3 +1,7 @@ +/** \file path.cpp +*/ + + #include "config.h" #include diff --git a/print_help.cpp b/print_help.cpp index 06bed30c2..965de7ec2 100644 --- a/print_help.cpp +++ b/print_help.cpp @@ -1,5 +1,4 @@ - -/** \file print_help.c +/** \file print_help.cpp Print help message for the specified command */ diff --git a/proc.cpp b/proc.cpp index 9c66292dc..b6b250a70 100644 --- a/proc.cpp +++ b/proc.cpp @@ -1,4 +1,4 @@ -/** \file proc.c +/** \file proc.cpp Utilities for keeping track of jobs, processes and subshells, as well as signal handling functions for tracking children. These @@ -383,8 +383,6 @@ static void mark_process_status(const job_t *j, process_t *p, int status) } else { - ssize_t ignore; - /* This should never be reached */ p->completed = 1; diff --git a/reader.cpp b/reader.cpp index 250884ffb..42e23e155 100644 --- a/reader.cpp +++ b/reader.cpp @@ -1,4 +1,4 @@ -/** \file reader.c +/** \file reader.cpp Functions for reading data from stdin and passing to the parser. If stdin is a keyboard, it supplies a killring, history, diff --git a/sanity.cpp b/sanity.cpp index f89769414..6d5a90878 100644 --- a/sanity.cpp +++ b/sanity.cpp @@ -1,4 +1,4 @@ -/** \file sanity.c +/** \file sanity.cpp Functions for performing sanity checks on the program state */ #include "config.h" diff --git a/screen.cpp b/screen.cpp index 7c02c3841..d4da5b6b8 100644 --- a/screen.cpp +++ b/screen.cpp @@ -1,4 +1,4 @@ -/** \file screen.c High level library for handling the terminal screen +/** \file screen.cpp High level library for handling the terminal screen The screen library allows the interactive reader to write its output to screen efficiently by keeping an internal representation @@ -298,7 +298,6 @@ size_t escape_code_length(const wchar_t *code) if (code[1] >= L'@' && code[1] <= L'_') { resulting_length = 2; - found = true; } } diff --git a/share/doxygen_sqlite3.db b/share/doxygen_sqlite3.db new file mode 100644 index 0000000000000000000000000000000000000000..0efa2bc71c024697799b4ff46f0ad3b6c1317d28 GIT binary patch literal 13312 zcmeHO&2G~`5cbAy-2y#v@Bvlbst7fz3#uxFxDk*+rDKk3@(4;Pdm zREY=Rz;hwd3s)Y23m4Yg+Vwi2ZD^#%bgkG~&+P2ZeCvthneppaWgH^d^oeVRa9L6$ z0Hh}nN|FTVK1KI?;_js-Im|>Y=WA-l(A=3qf|3st@N~Pz+OI_$2MH4)QlHK6>d~l)=Jen zTs7*jv{_qUsZi-Pqf&#Fb-Hhs%Q|eB0fIH-O^S9hYKBVHp+oaMTf`5O*^)7LG3lii zJEp8^3k#roz>JONO<9^bRX8&<%+a-Rqc9$sSZ5XnI}W{Sw*s`&MxKQ-r!r?@hB@z< zF4C!Fv0DJDHa7=8uCg&>#B9_|H4EHWDaN2kMbl=M_#O5xw(9+^4{UEWv4eUq5eIvH zsFv@vT`%rU{cAFEXH{Vip7!cXyPg<8ARrLP3j)Ib^RiMxPl3Sj5fJ`Ad`!iN0)f0B zApAcsD<$+42n-(q;s3+ORE#JP$O{6I|0~jwBprbtg$MF&xh^f9rMr@osA*2rq-lbo z2X~VUL~-~r^XrglxK^nnasNN-*G}*R0{=Gx?EVi9C2&}{U-&LRm%d70M#5sH^JqfV zG!1muSbBD!-X{ZgxXGnt8EMdDEDVU1Nyb7u2(zTW=2&4m$*My>xmt8prg-NuQ#{Jj z2JCQyQ=E}v#XEP$RBd`1bnh@3>{(9RMnU{N&Pm49Sop#P365`>PMiZy{wC_=r=s~2|xi_wAv$LS9ov7&{VmW3&6^&aH8C7HYz{>XfU(~-SqBphvFH3M?6#Gn< z-)mLe|3~82PADM|xDo_}|6d90Vp4&?NFX5me#Aau9Q&`!i7qkPXfNC*U(cJu~FLf9ji7uiN3 zPYALE)1vPf1U^Z|Fl~NJf?R)>n}wJ-;0UbPKSrxxY=cH&8tICDy}<$4;Dbz2&?epc PG@6r^I;HZ`3BC9SIQ<{$ literal 0 HcmV?d00001 diff --git a/signal.cpp b/signal.cpp index 8e62f7885..d4a8d1b28 100644 --- a/signal.cpp +++ b/signal.cpp @@ -1,4 +1,4 @@ -/** \file signal.c +/** \file signal.cpp The library for various signal related issues @@ -477,7 +477,7 @@ static void handle_int(int sig, siginfo_t *info, void *context) } /** - sigchld handler. Does notification and calls the handler in proc.c + sigchld handler. Does notification and calls the handler in proc.cpp */ static void handle_chld(int sig, siginfo_t *info, void *context) { diff --git a/tokenizer.cpp b/tokenizer.cpp index 67b35fff2..7e4fe02eb 100644 --- a/tokenizer.cpp +++ b/tokenizer.cpp @@ -1,4 +1,4 @@ -/** \file tokenizer.c +/** \file tokenizer.cpp A specialized tokenizer for tokenizing the fish language. In the future, the tokenizer should be extended to support marks, diff --git a/util.cpp b/util.cpp index 85b9d8d7d..618836878 100644 --- a/util.cpp +++ b/util.cpp @@ -1,4 +1,4 @@ -/** \file util.c +/** \file util.cpp Generic utilities library. Contains datastructures such as automatically growing array lists, priority queues, etc. diff --git a/wgetopt.cpp b/wgetopt.cpp index ecf1121e5..c28d5dc17 100644 --- a/wgetopt.cpp +++ b/wgetopt.cpp @@ -1,4 +1,4 @@ -/** \file wgetopt.c +/** \file wgetopt.cpp A version of the getopt library for use with wide character strings. This is simply the gnu getopt library, but converted for use with diff --git a/wildcard.cpp b/wildcard.cpp index 2b93561b5..8682f75e1 100644 --- a/wildcard.cpp +++ b/wildcard.cpp @@ -1,4 +1,4 @@ -/** \file wildcard.c +/** \file wildcard.cpp Fish needs it's own globbing implementation to support tab-expansion of globbed parameters. Also provides recursive diff --git a/wutil.cpp b/wutil.cpp index ffb4f2b22..6889e9c96 100644 --- a/wutil.cpp +++ b/wutil.cpp @@ -1,4 +1,4 @@ -/** \file wutil.c +/** \file wutil.cpp Wide character equivalents of various standard unix functions. */ diff --git a/xdgmime.cpp b/xdgmime.cpp index 633d0b0a5..52a8f21b9 100644 --- a/xdgmime.cpp +++ b/xdgmime.cpp @@ -1,3 +1,6 @@ +/** \file xdgmime.cpp +*/ + /* -*- mode: C; c-file-style: "gnu" -*- */ /* xdgmime.c: XDG Mime Spec mime resolver. Based on version 0.11 of the spec. * diff --git a/xdgmimealias.cpp b/xdgmimealias.cpp index e556d4e64..4636b5652 100644 --- a/xdgmimealias.cpp +++ b/xdgmimealias.cpp @@ -1,5 +1,7 @@ +/** \file xdgmimealias.cpp +*/ /* -*- mode: C; c-file-style: "gnu" -*- */ -/* xdgmimealias.c: Private file. Datastructure for storing the aliases. +/* xdgmimealias.cpp: Private file. Datastructure for storing the aliases. * * More info can be found at http://www.freedesktop.org/standards/ * diff --git a/xdgmimeglob.cpp b/xdgmimeglob.cpp index 4182f3c97..06021d7cb 100644 --- a/xdgmimeglob.cpp +++ b/xdgmimeglob.cpp @@ -1,5 +1,7 @@ +/** \file xdgmimeglob.cpp +*/ /* -*- mode: C; c-file-style: "gnu" -*- */ -/* xdgmimeglob.c: Private file. Datastructure for storing the globs. +/* xdgmimeglob.cpp: Private file. Datastructure for storing the globs. * * More info can be found at http://www.freedesktop.org/standards/ * diff --git a/xdgmimeint.cpp b/xdgmimeint.cpp index 7e8ea31ca..0bad11af0 100644 --- a/xdgmimeint.cpp +++ b/xdgmimeint.cpp @@ -1,5 +1,8 @@ +/** \file xdgmimeint.cpp +*/ + /* -*- mode: C; c-file-style: "gnu" -*- */ -/* xdgmimeint.c: Internal defines and functions. +/* xdgmimeint.cpp: Internal defines and functions. * * More info can be found at http://www.freedesktop.org/standards/ * diff --git a/xdgmimemagic.cpp b/xdgmimemagic.cpp index aecca8822..762202202 100644 --- a/xdgmimemagic.cpp +++ b/xdgmimemagic.cpp @@ -1,3 +1,6 @@ +/** \file xdgmimemagic.cpp +*/ + /* -*- mode: C; c-file-style: "gnu" -*- */ /* xdgmimemagic.: Private file. Datastructure for storing magic files. * diff --git a/xdgmimeparent.cpp b/xdgmimeparent.cpp index d0fa617dc..72fa8b08a 100644 --- a/xdgmimeparent.cpp +++ b/xdgmimeparent.cpp @@ -1,3 +1,5 @@ +/** \file xdgmimeparent.cpp +*/ /* -*- mode: C; c-file-style: "gnu" -*- */ /* xdgmimealias.c: Private file. Datastructure for storing the hierarchy. *